Search This Blog

Monday, April 27, 2009

Export data into csv from Postgres:

Execute the command: \copy to '' delimiter ','

Example: \copy employee to '/opt/test/employeeExport.csv' delimiter ','

Import data from csv into Postgres:

Execute the command: copy from '/path' using delimiter ','

Example:
copy employee from '/opt/test/employeeExport.csv' using delimiters ','

No comments: