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;
Long
  • 13
  • 1
  • 4
  • `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. –  Jun 18 '18 at 09: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 Jun 18 '18 at 10:39

0 Answers0