Reputation: 134
I'm trying to import a C-Language function to my postgresql database.
I have my shared object inside my home directory but I can't use it on my database.
CREATE OR REPLACE FUNCTION add_one(integer) RETURNS integer AS '/home/pedro/.../.../example.so', 'add_one' LANGUAGE C STRICT;
And this is my error message:
ERROR: could not access file "/home/pedro/.../.../example.so": Permission denied
I think is probably my OS blocking access to this file but I don't want to give permission to all users.
tl;dr: I'm looking for a elegant solution to import my C-Language Function, as a Shared Object file, inside my postgresql database.
Thanks in advance!
Upvotes: 1
Views: 1471
Reputation: 26464
You need to give permission to the postgres user since that's the user the database runs under. Note that you can then give permission to run the function to database users (by default they may have it unless you revoke access from public).
Upvotes: 2