windowspostgresqlcsv

Permission denied when trying to import a CSV file from PGAdmin


I'm using PGAdmin 1.14.3.

When I try to execute an import command:

COPY grad(country_code, postal_code, place_name, admin_name1, admin_code1, admin_name2, admin_code2, admin_name3, admin_code3, latitude, longitude, accuracy)
FROM 'C:\\Users\\denis\\Desktop\\BP2Project\\USA\\US.txt';

I get a

ERROR: could not open file "C:\Users\denis\Desktop\BP2Project\USA\US.txt" for reading: Permission denied SQL state: 42501

I did look up other similar questions and none of them solved my issue.

I logged in as user "postgres" who is the superuser. I don't see why I'm missing permissions. I'm on Windows 7.


Solution

  • The user Postgres must have read access on the file from which you are about to copy.

    Look at this article to see how to modify files' security access on Windows.