Computer: Mac OS X, version 10.8 Database: Postgres
Trying to import csv file into postgres.
pg> copy items_ordered from \'/users/darchcruise/desk
I resolved the same issue with a recursive chown on the parent folder:
sudo chown -R postgres:postgres /home/my_user/export_folder
(my export being in /home/my_user/export_folder/export_1.csv
)
just in case you're facing this problem under windows 10 , add the group of users "youcomputer\Users" on the security Tab and grant it full control , that solved my issue
I had the same error message but was using psycopg2
to communicate with PostgreSQL. I fixed the permission issues by using the functions copy_from
and copy_expert
that will open the file on the client side as the user running the python script and feed the data to the database over STDIN
.
Refer to this link for further information.