Skip to content

Copy data as fast as possible with a job in the cloud (Big query and Cloud SQL) #803

Closed Answered by dvarrazzo
JPFrancoia asked this question in Q&A
Discussion options

You must be logged in to vote
  • using write() instead of write_row() is definitely a better approach: you read block by block and write block by block with no Python parsing.
  • pipeline mode and COPY are not compatible. You can't use COPY in pipeline mode.
  • Everything that postgres understand is documented in the COPY command. This interest you especially around CVS parsing (separators, title row, etc). If postgres understand what you are sending it, then you can use psycopg block copy without any parsing on the client. If your CSV is in a dialect that Postgres doesn't understand, you are out of luck and you will need some form of parsing. I don't know what reading from a JSON file would mean.
  • Beware of #745: we have a CO…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by JPFrancoia
Comment options

You must be logged in to vote
2 replies
@dvarrazzo
Comment options

@JPFrancoia
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #802 on April 29, 2024 18:31.