Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgres select as csv

-- To stdout
COPY (select * from table) TO STDOUT WITH CSV HEADER;

-- To file
COPY (select * from table) TO '/table.csv' WITH CSV HEADER;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #postgres #select #csv
ADD COMMENT
Topic
Name
1+3 =