When I do this:
COPY "mytable" FROM '/my/file.csv' WITH DELIMITER AS ',' CSV;
-rw-r--r-- 1 peter peter 54819176 2011-07-21 13:17 file.csv
psql tells me this:
ERROR: could not open file "/my/file.csv" for reading: Permission denied
How can I read my file?? Thanks!
It looks like something called
apparmor is installed by default in Ubuntu.
Seems to have the same functionality as SELinux, mentioned in the comments.
apparmor, I still have the same problem.
selinux is not installed.
Regarding the comment below about access, the COPY FROM is being run from a superuser account (it gives a different error message if not) and the file permissions, copied above, I understand as "readable by everyone".
I tried to get to the file under the
postgres user. It gets stuck at a particular place in the tree
drwxr--r-- 6 peter peter 4096 2011-04-14 14:03 phm
postgres@dexter:/home/peter/PyPacks$ cd phm
bash: cd: phm: Permission denied
I suppose I will just put the file somewhere else, but this is strange!