PostgreSQL file reading permission denied

asked 2012-12-03 16:10:07 +0000

updated 2013-08-15 11:32:29 +0000

I'm doing a work for the university, and I have a problem When I try to read a file (jpg, txt, or whatever) PostgreSQL returns:

ERROR: could not open server file "/file": Permission denied

** Error **

I'm trying to find a solution over internet, but there's no solution (or I can't find it)

I'm doing the other exercises now, I made scripts, and executed it with "sudo", but it didn't work.

Can someone help me? I need postgre to read files

(Sorry about my english)

edit retag flag offensive close merge delete



Ran through the same problem, and this is the solution I found:

Create a new folder (for instance, tmp) under /home

$ cd /home

make postgres the owner of that folder

$ chown -R postgres:postgres tmp

copy in tmp the files you want to write into the database, and make sure they also are owned by postgres.

That's it. You should be in business after that.

Buffalo ( 2013-08-14 18:08:38 +0000 )edit