Error Could Not Open File For Reading Permission Denied Windows
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Could Not Open File For Reading Permission Denied Postgres
Discuss the workings and policies of this site About Us Learn more postgres copy permission denied windows about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Postgresql Copy Could Not Open File For Reading No Such File Or Directory
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping psql permission denied windows each other. Join them; it only takes a minute: Sign up Postgres ERROR: could not open file for reading: Permission denied up vote 20 down vote favorite 4 Computer: Mac OS X, version 10.8 Database: Postgres Trying to import csv file into postgres. pg> copy items_ordered from '/users/darchcruise/desktop/items_ordered.csv' with CSV; ERROR: could not open file "/users/darchcruise/desktop/items_ordered.csv" for postgres copy permission denied linux reading: Permission denied Then I tried $> chown postgres /users/darchcruise/desktop/items_ordered.csv chown: /users/darchcruise/desktop/items_ordered.csv: Operation not permitted Lastly, I tried $> ls -l -rw-r--r-- 1 darchcruise staff 1016 Oct 18 21:04 items_ordered.csv Any help is much appreciated! postgresql share|improve this question edited Oct 19 '13 at 6:41 Basilevs 6,84853177 asked Oct 19 '13 at 6:20 user2449984 110118 add a comment| 6 Answers 6 active oldest votes up vote 6 down vote accepted chmod a+rX /users/darchcruise/ /users/darchcruise/desktop /users/darchcruise/desktop/items_ordered.csv This will change access rights for your folder. Note that everyone will be able to read your file. You can't use chown being a user without administrative rights. Also consider learning umask to ease creation of shared files. share|improve this answer answered Oct 19 '13 at 6:43 Basilevs 6,84853177 This worked perfectly! Thank you –user2449984 Oct 19 '13 at 6:57 Hi, a little one liner that would do this task for you: a=pwd;NumOfSlashes=$((echo $a | sed 's/[^/]//g' | wc -c - 1 )); for ((i=1;i<=$NumOfSlashes;i++)); do chmod a+rX $a; a=dirname $a;done; –Ro
Regional lists Associations User groups Project lists pgadmin-hackers pgadmin-support pgsql-jdbc pgsql-odbc pgsql-pkg-debian pgsql-pkg-yum psycopg Inactive lists IRC Local User
Error: Could Not Open File For Writing: Permission Denied Sql State: 42501
Groups Featured Users International Sites Propaganda Resources Weekly News cp cannot open for reading permission denied Re: COPY permissions problem - Windows XP From: "Jim C(dot) Nasby"
Error: Extra Data After Last Expected Column
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://dba.stackexchange.com/questions/4021/psql-denies-access-to-file-when-using-copy-from site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a permission denied minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top psql denies access to file when using COPY FROM up vote 3 down vote favorite 1 When I do this: COPY "mytable" FROM '/my/file.csv' WITH DELIMITER AS ',' CSV; On this: -rw-r--r-- 1 peter peter 54819176 2011-07-21 13:17 file.csv could not open psql tells me this: ERROR: could not open file "/my/file.csv" for reading: Permission denied How can I read my file?? Thanks! --- Update It looks like something called apparmor is installed by default in Ubuntu. Seems to have the same functionality as SELinux, mentioned in the comments. --- Update After removing 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". --- Update 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! postgresql psql csv-file share|improve this question edited Jul 22 '11 at 15:16 asked Jul 21 '11 at 20:19 Pete 118116 1 are you running SELinux or something like it? –Jack Douglas♦ Jul 21 '11 at 20:30 wiki.ubuntu.com/SELinux &n