diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index e522113ab2..d14f0581e6 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -591,10 +591,8 @@ EOF psql to issue a BEGIN command before the first such option and a COMMIT command after the last one, thereby wrapping all the commands into a single - transaction. If any of the commands fails, a - ROLLBACK command is sent instead. This ensures that - either all the commands complete successfully, or no changes are - applied. + transaction. This ensures that either all the commands complete + successfully, or no changes are applied. diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 9aa665d325..110906a4e9 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -411,9 +411,7 @@ main(int argc, char *argv[]) if (options.single_txn) { - res = PSQLexec((successResult == EXIT_SUCCESS) ? - "COMMIT" : "ROLLBACK"); - if (res == NULL) + if ((res = PSQLexec("COMMIT")) == NULL) { if (pset.on_error_stop) {