Psql

Aus SchnallIchNet
Wechseln zu: Navigation, Suche

export to CSV-file

postgres >= 8.2

COPY (SELECT count(*) FROM pg_class) TO '/tmp/file.csv' CSV;

other posible ways:

SELECT * FROM table \g /tmp/testing

or

\o /tmp/testing
select * from table;