aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-06-10 16:34:25 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-06-10 16:34:25 -0400
commit030da9b6fd5254a0878bcf9fab10cf70c86d4927 (patch)
tree7abae217a557df9bc04195e05fbca8e807043105
parentd3ef5c3ef454ccd4a14b64e577777179a91c1641 (diff)
downloadpostgresql-030da9b6fd5254a0878bcf9fab10cf70c86d4927.tar.gz
postgresql-030da9b6fd5254a0878bcf9fab10cf70c86d4927.zip
Revert "Fix psql's single transaction mode on client-side errors with -c/-f switches".
This reverts commits a04ccf6df et al. in the back branches only. There was some disagreement already over whether to back-patch 157f8739a, on the grounds that it is the sort of behavioral change that we don't like to back-patch. Furthermore, it now looks like the logic needs some more work, which we don't have time for before the upcoming 14.4 release. Revert for now, and perhaps reconsider later. Discussion: https://postgr.es/m/17504-76b68018e130415e@postgresql.org
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml6
-rw-r--r--src/bin/psql/startup.c4
2 files changed, 3 insertions, 7 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index afad0025699..86c8b84223b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -592,10 +592,8 @@ EOF
<application>psql</application> to issue a <command>BEGIN</command> command
before the first such option and a <command>COMMIT</command> command after
the last one, thereby wrapping all the commands into a single
- transaction. If any of the commands fails, a
- <command>ROLLBACK</command> 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.
</para>
<para>
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 2f870921ed3..67653ae75f8 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -416,9 +416,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)
{