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.
  • 19,945
  • 7
  • 68
  • 85
St.Antario
  • 26,175
  • 41
  • 130
  • 318
  • 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