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;
 
PREVIOUS NEXT
Tagged: #postgres #select #csv
ADD COMMENT
Topic
Name
9+3 =