Red shift COPY TO file from Xen tables not supported

I am trying to copy (not upload) a table from redshift to a local file.
I run psql:

\copy my_schema.my_table to 'my_file.csv' with csv;  

I get an error

ERROR:  COPY TO file from Xen-tables not supported

Performance

\copy (select * from my_schema.my_table) to 'my_file.csv' with csv;  

causes a syntax error:

ERROR:  syntax error at or near "("

How do I make a copy?
Thanks
Daphne

+4
source share
1 answer

You can redirect psql output to a local file:

psql [your connection options go here] -F, -A \
  -c 'select * from my_schema.my_table' >my_file.csv

-F, sets the field separator to a comma

-A gives aligned / unformatted output

To specify a different dividing channel, use '|'instead -F.

. , .

+5

Source: https://habr.com/ru/post/1545132/


All Articles