-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Opening this issue, following this: multi-query is atomic?
This was originally posted against pg-promise
, but quick tests revealed that's how node-postgres
works, surprisingly. And I am totally caught up by this revelation myself. I was sure that when executing a multi-query string the operation wasn't atomic, but turns out that it is.
Steps to reproduce
Execute something like this with a single call to the query
method:
INSERT INTO table VALUES(1, 2);INSERT INTO table VALUES(3, 4);bla-bla
Expected results
Two records are inserted, and then an error is thrown, about the invalid bla-bla
query.
Actual results
The two inserted records are rolled back, following the last-query error, even though we do not use any transaction 😮
Metadata
Metadata
Assignees
Labels
No labels