Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk uploading: COPY ... FROM STDIN WITH CSV #11

Open
btakita opened this issue Jul 17, 2022 · 1 comment
Open

Bulk uploading: COPY ... FROM STDIN WITH CSV #11

btakita opened this issue Jul 17, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@btakita
Copy link

btakita commented Jul 17, 2022

Is your feature request related to a problem? Please describe.
Bulk updates are significantly faster using COPY instead of single sql queries.

Describe the solution you'd like

const { stream } = pg.query(` COPY my_table (col1, col2, etc) FROM STDIN WITH CSV`, { stream: true })
createReadStream('./data.csv').on('data', $=>stream.write($)).on('close', ()=>stream.close())

Describe alternatives you've considered

  • Using psql from shell or another library/language
  • Not using COPY. Use order of magnitude slower queries instead.

Additional context
https://www.citusdata.com/blog/2017/11/08/faster-bulk-loading-in-postgresql-with-copy/

@erayhanoglu
Copy link
Member

Hi Brian, thank you for your feedback. COPY operation is not implemented yet. I am marking this issue as a feature request.

@erayhanoglu erayhanoglu added the enhancement New feature or request label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants