In the docs on https://www.postgresql.org/docs/8.2/static/sql-insert.html it states:
To insert multiple rows using the multirow VALUES syntax:
INSERT INTO films (code, title, did, date_prod, kind)
VALUES ('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'),
('HG120', 'The Dinner Game', 140, DEFAULT, 'Comedy');
So I imagine, a parametrised query would look like:
INSERT INTO films (code, title, did, date_prod, kind)
VALUES ($1, $2, $3, $4, $5'),
($6, $7, $8, $9, $10);
The above query is meant to insert two rows. But what if I want to insert a variable number of rows, or I don't know the number of rows until run time. Is there a better way to write this statement?