Postgres ERROR: could not open file for reading: Permission denied

前端 未结 15 2267
慢半拍i
慢半拍i 2020-12-04 13:15

Computer: Mac OS X, version 10.8 Database: Postgres

Trying to import csv file into postgres.

pg> copy items_ordered from \'/users/darchcruise/desk         


        
相关标签:
15条回答
  • 2020-12-04 13:54

    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)

    0 讨论(0)
  • 2020-12-04 13:54

    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

    0 讨论(0)
  • 2020-12-04 13:54

    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.

    0 讨论(0)
提交回复
热议问题