Postgres Copy To command

435 views
Skip to first unread message

R S

unread,
Oct 31, 2017, 12:21:03 PM10/31/17
to Google Cloud SQL discuss
I understand that \copy is available. However I have a HUGE query that COPY would work far better than \copy.

Is there anyway at all to use COPY TO with GCloud Postgres?

Kenworth (Google Cloud Platform)

unread,
Oct 31, 2017, 5:56:25 PM10/31/17
to Google Cloud SQL discuss
COPY TO command is not available with Cloud SQL for PostgreSQL. As an alternative, you can use:

gcloud sql instances import (or export)

You can consult this article for more information about import and export.

R S

unread,
Nov 1, 2017, 9:38:59 AM11/1/17
to Google Cloud SQL discuss
This doesn't help because you can't use a query. It's simple importing and exporting tables.

Kenworth (Google Cloud Platform)

unread,
Nov 1, 2017, 12:25:22 PM11/1/17
to Google Cloud SQL discuss
True, it can only do 'table' granular import/export. For the use of COPY TO command, I highly encourage you to submit a feature request  as described in this article so that proper weight and attention be given to it. You can also refer on this thread as a background to the request.

Chris Bandy

unread,
Nov 3, 2017, 10:19:19 AM11/3/17
to Google Cloud SQL discuss
Is the query large or are the results large? If it's the query, you should be able to pass it entirely to the psql \copy command in parentheses.

Reply all
Reply to author
Forward
0 new messages