I'm working with PostgreSQL 9.6, I tried to put:
COPY (SELECT * FROM estado) TO E'"C:\Users\freqde\Documents\A.csv"';
But I get the following error:
no se permiten rutas relativas para COPY hacia un archivo
I'm working with PostgreSQL 9.6, I tried to put:
COPY (SELECT * FROM estado) TO E'"C:\Users\freqde\Documents\A.csv"';
But I get the following error:
no se permiten rutas relativas para COPY hacia un archivo
Try to eliminate the double quotes:
COPY (SELECT * FROM estado) TO E'C:\Users\freqde\Documents\A.csv';
Remember that if your database is not on your computer, the copy will try to do it on the remote computer where the database is located.
I used it in the following way and it worked correctly:
COPY (SELECT * FROM tabla) TO E'/folder1/folder2/archivo.csv';
I also modified the public permissions of the csv file for writing.