RangeError when doing bulk insert of ~5000 rows
I've got a JS array of about 5000 objects that I want to insert all at once (to keep all or nothing). However, on insert, I'm getting this error:
RangeError: Variable $100001 exceeds supported maximum of $100000
It's an odd error to me because a) i've only got ~5000 rows and b) if i do the rows one at a time, they work fine so it's nothing with the data in the rows.
I know i've seen a few pieces of documents on bulk row insertion, but this doesn't seem related to any memory/cpu issues, so i thought it would be interesting to report.
full stack trace is:
(node:75873) UnhandledPromiseRejectionWarning: RangeError: Variable $100001 exceeds supported maximum of $100000 at query.replace.name (/Users/project/node_modules/pg-promise/lib/formatting.js:176:23) at String.replace (<anonymous>) at Object.array (/Users/project/node_modules/pg-promise/lib/formatting.js:172:22) at Object.formatQuery (/Users/project/node_modules/pg-promise/lib/formatting.js:296:29) at Database.$query (/Users/project/node_modules/pg-promise/lib/query.js:129:40) at Database.<anonymous> (/Users/project/node_modules/pg-promise/lib/query.js:263:23) at config.$npm.connect.pool.then.db (/Users/project/node_modules/pg-promise/lib/database.js:329:42) at process._tickCallback (internal/process/next_tick.js:68:7)