I'm using pg module (and the promise version pg-promise-strict).
When I need to insert 1k records I must send to the server one by one.
I can't build a 1k record INSERT because my organization policies: the data MUST be sended separately (as seen in https://github.com/brianc/node-postgres/wiki/Client#method-query-parameterized)
I try to write a plsql function that does the bulk insert and send all the data in an array (or in a string, I try boths):
client.query("select bulk_insert", [allTheData], cb);
And I obtain the following message:
index row requires 38656 bytes, maximum size is 8191
Notes
- The database is in other server
- I only be able to connect with de postgres port
- I'm not able to execute something like
sh psql < "COPY..."
How can I do the bulk insert sending the data separately?