0

I'm trying to export table's data into a file with csv format.

COPY (SELECT * FROM mailing.value) TO 'C:\\Users\\asd\\Desktop\\value.csv' (format csv);

But I got with

ERROR: relative path not allowed for COPY to file

How can I fix that?

Vivek S.
  • 15,777
  • 6
  • 54
  • 78
St.Antario
  • 23,179
  • 26
  • 96
  • 243
  • not that I have any experience with this but you might want to take a look at http://stackoverflow.com/questions/1517635/save-pl-pgsql-output-from-postgresql-to-a-csv-file – Jeremy C. May 05 '15 at 07:22
  • @MaheshKava I've tried this but it didn't work. – St.Antario May 05 '15 at 07:27
  • Searching for the error message can be handy. In this case I think maybe we need to add a `HINT` message in the error... – Craig Ringer May 05 '15 at 07:46
  • Odd, I think the real issue is that we're detecting that as a relative path. Though more HINTs in those COPY errors in general would be good. – Craig Ringer May 05 '15 at 09:25

0 Answers0