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;
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.\copy
too. It doesn't has error neither creating the file