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

batch insert gives error #86

Open
rabiSharelookapp opened this issue Apr 1, 2021 · 10 comments
Open

batch insert gives error #86

rabiSharelookapp opened this issue Apr 1, 2021 · 10 comments
Labels
question Further information is requested

Comments

@rabiSharelookapp
Copy link

rabiSharelookapp commented Apr 1, 2021

while query is done for batchInsert it insert the multiple row but throws an error "BadRequestException:Batch entry 1 was aborted: Too many update results were returned. Call getNextException to see othe errors in the batch". though the items passed as same structure as in document . Here 1 is number of entry
Screenshot from 2021-04-01 11-16-36

@jeremydaly
Copy link
Owner

This looks like a Postgres error. Are you able to run a smaller batch?

@jeremydaly jeremydaly added the question Further information is requested label Apr 1, 2021
@rabiSharelookapp
Copy link
Author

rabiSharelookapp commented Apr 2, 2021 via email

@rabiSharelookapp
Copy link
Author

what would be the solution for this @jeremydaly

@jeremydaly
Copy link
Owner

@ffxsam Any thoughts on this? Haven't seen this error with batches before.

@rabiSharelookapp
Copy link
Author

rabiSharelookapp commented Apr 3, 2021

@jeremydaly today I got another situation that if table not exist then batch insertion execution is only done for 1 batch more than one it gives error but after 1 batch entry or table exist then more than 1 batch be inserted.Is this from my side or the issue (I have used create table if not exist query to create table and followed by insert script)

@ffxsam
Copy link
Collaborator

ffxsam commented Apr 3, 2021

No, sorry I can't be of any help. I actually don't use batch inserts very often. Plus, I'm using knex to build all my queries before passing the resulting string to dataApi.query().

@rabiSharelookapp
Copy link
Author

rabiSharelookapp commented Jun 7, 2021 via email

@rabiSharelookapp
Copy link
Author

rabiSharelookapp commented Jun 7, 2021 via email

@ffxsam
Copy link
Collaborator

ffxsam commented Jun 7, 2021

@rabiSharelookapp knex works fine with dataApi. You can use it like this:

const knex = require('knex')({ client: 'pg' });

async function doTheThing() {
  const results = await dataApi.query(knex('my_table').select('a', 'b', 'c'));
}

As for your other question, that's a bit of a general and very involved question that I unfortunately don't have time to help with.

@rabiSharelookapp
Copy link
Author

rabiSharelookapp commented Jun 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants