I am using
\COPY ( SELECT * FROM person LEFT JOIN car ON car.id=person.car_id ) TO 'c:/Users/nick-/Downloads/results.csv' DELIMITER ',' CSV HEADER; and am getting the error
ERROR: syntax error at or near "TO" LINE 6: TO 'c:/Users/nick-/Downloads/results.csv' I've also tried COPY rather than \COPY but I get this error
ERROR: could not open file "c:/Users/nick-/Downloads/results.csv" for writing: Permission denied HINT: COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy. I have tried using all of the below
c:/Users/nick-/Downloads/results.csv c://Users//nick-//Downloads//results.csv 'c:\Users\nick-\Downloads\results.csv' 'c:\\Users\\nick-\\Downloads\\results.csv' and none have worked.
C:\users\nick). Either change yourDownloadsdirectory permissions to allow Postgres access - or have Postgres write to a folder that it does have permission to write to (such as a folder withinC:\Program Files\Postgres\...orC:\Users\Public\Documents)C:\Users\Public\Documentsusing both that syntax and'C:/Users/Public/Documents'and gotERROR: syntax error at or near "TO" LINE 6: TO 'C:/Users/Public/Documents'again. So I have gotten passed the access, but now am having the same problem as listed above.