Pivotal Knowledge Base

Follow

HowTo - Copy GPDB data to a CSV file

Goal

Provide help copying the GPDB data to a CSV format.

Solution

To copy the GPDB to a CSV format , you can use the below command.

\copy <table_name> to '<any_name>.csv' csv header;

or you can restrict the rows / columns with your own queries similar to the example below.

\copy (select col1, col2 .... from <table_name> where ... ) to '<any_name>.csv' csv header;

Comments

Powered by Zendesk