0

I'm using Putty to connect to Postgres 9.6.

I'm trying to export to csv five but I keep getting this error:

ERROR: relative path not allowed for COPY to file

This is my code:

COPY (select * from res_users) TO E'G:\\Test.csv' DELIMITER ',' CSV HEADER;
2
  • copy runs on the server and creates the file on the server. So the path needs to comply with the file system rules for the server operating system. If you are using Putty Postgres most probably runs on a Linux machine, so a Windows path isn't valid there to begin with.
    – user330315
    Commented Jun 18, 2018 at 9:54
  • @a_horse_with_no_name So what do I need to do? I'm trying to use \copy too. It doesn't has error neither creating the file
    – Long
    Commented Jun 18, 2018 at 10:39

0

Browse other questions tagged or ask your own question.