5

I am trying to export the results of a query in BigQuery, and get the data into Postgres. The data may be as much 250 million record, ~26Gb.

Option 1:

Save query results to a temp table Export table to csv(s) Bulk upsert to postgres

(This will be slow)

Option 2:

Somehow get the two DBs to speak directly I don't know if this is possible

Thank you for any information!!!

1 Answer 1

5

This BigQuery Foreign Data Wrapper for postgreSQL allows you to query BigQuery directly from within PostgreSQL. Using this and a SELECT INTO statement should allow you to efficiently and directly copy from BigQuery to PostgreSQL.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for the recommendation! I will mark this as the answer when I get it working.
This might work for queries that reduce data from the original 26GB to an understandable result - but for 26GB of data I'll recommend to export to CSV and re-import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.