Pivotal Knowledge Base

Follow

How to Copy Greenplum Data to a CSV File

Environment

Pivotal Greenplum Database (GPDB) all versions

Purpose

Provide help copying the GPDB data to a CSV format.

Procedure

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