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

前端 未结 15 2329
慢半拍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 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.

提交回复
热议问题