Halaman

Selasa, 18 Mei 2010

Export PostgreSQL table into CSV file

1. Change directory to PostgreSQL binary folder or just type this command if the search path is already listed in your environment paths.

C:\pgsql83\bin>psql -dmydb -Uferry

mydb# COPY customer TO 'C:/myfolder/allcust.csv' DELIMITER ';';
COPY 5076

mydb# COPY (SELECT * FROM customer WHERE city ='PNK') TO E'C:\\myfolder\cityPNK.csv' DELIMITER ';' CSV;
COPY 502

mydb# \q

See: Import from CSV files into PostgreSQL Table

Tidak ada komentar:

Posting Komentar