From 030da9b6fd5254a0878bcf9fab10cf70c86d4927 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 10 Jun 2022 16:34:25 -0400 Subject: 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 --- src/bin/psql/startup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3