Huge inserts fail
See original GitHub issueI tried to paste together code from different sources and boil down the example as much as possible so I apologize for the messy code: https://gist.github.com/Rauno56/c3369b58111ffbe17ff63d64289e4aa6 On my setup this fails with
bind message supplies 26784 parameters, but prepared statement "" requires 420000
even though parameter count and placeholder count match(see from the outputs).
If you were to change N smaller or chunk up the request it does fine. Seems like the input of parameters is cut short at some point.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
large inserts fail · Issue #2000 · hasura/graphql-engine - GitHub
I tried bulk inserting a table from our existing database. There were 9 fields for each object. Hasura gobbled up 7000 objects in...
Read more >Huge Inserts Fail - SQL Server Forums - SQLTeam.com
A SQL proc takes care of decompressing a zip file and it inserts data into table from the files present in the decompressed...
Read more >Error While Inserting large amount of data using Insert ...
My first suggestion would be to put a "GO" statement after every INSERT statement. This will break your single batch of 45,000 INSERT...
Read more >Huge Insert! - Ask TOM
The insert might fail with a 1555 because the query: select delId, nval, prod_id, ... I have the huge (128 million rows) SUBS...
Read more >Optimize Large SQL Server Inserts, Updates, Deletes with ...
Problem. Sometimes you must perform DML processes (insert, update, delete or combinations of these) on large SQL Server tables.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could not use UNNEST in my case as the db version was tiny bit short of supporting it. Precompiled using pg-promise’s helpers. I think this limit of parameters should at least be documented and alternatives provided here, in pg module too.
Thank you very much @charmander @vitaly-t
Arrays worked like a charm, thanks @charmander ! Unrelated to this issue, I have one question that maybe you can help: I’m trying to implement an “optional upsert”. That is:
Here’s what I came up with so far:
The problem is, since
shouldUpdateCol3
,shouldUpdateCol4
andshouldUpdateCol5
are not selected in theSELECT FROM UNNEST
above, this does not work.However, if I add them to the
SELECT FROM UNNEST
, then I getINSERT has more expressions than target columns
error.Do you know how I can accomplish this?