Skip to content

How to insert multiple rows in a single PostgreSQL query? #730

Answered by kyleconroy
namndev asked this question in Q&A
Discussion options

You must be logged in to vote

Sadly, this isn't currently supported. Your unnest solution is interesting, I wonder how well it performs for a large number of records. How many records are your trying to insert? PostgreSQL has a guide for inserting large amounts of data. If you aren't inserting many records, I'd just use a transaction. Sorry that there isn't a better answer.

This has also been discussed in #216 and #218, which you may find helpful.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@namndev
Comment options

Answer selected by kyleconroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #730 on October 19, 2020 06:43.