8000 Revert "Fix psql's single transaction mode on client-side errors with… · postgres/postgres@aaa88d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit aaa88d3

Browse files
committed
Revert "Fix psql's single transaction mode on client-side errors with -c/-f switches".
This reverts commits a04ccf6 et al. in the back branches only. There was some disagreement already over whether to back-patch 157f873, 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
1 parent 199aac8 commit aaa88d3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,8 @@ EOF
582582
<application>psql</application> to issue a <command>BEGIN</command> command
583583
before the first such option and a <command>COMMIT</command> command after
584584
the last one, thereby wrapping all the commands into a single
585-
transaction. If any of the commands fails, a
586-
<command>ROLLBACK</command> command is sent instead. This ensures that
587-
either all the commands complete successfully, or no changes are
588-
applied.
585+
transaction. This ensures that either all the commands complete
586+
successfully, or no changes are applied.
589587
</para>
590588

591589
<para>

src/bin/psql/startup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ main(int argc, char *argv[])
386386

387387
if (options.single_txn)
388388
{
389-
res = PSQLexec((successResult == EXIT_SUCCESS) ?
390-
"COMMIT" : "ROLLBACK");
391-
if (res == NULL)
389+
if ((res = PSQLexec("COMMIT")) == NULL)
392390
{
393391
if (pset.on_error_stop)
394392
{

0 commit comments

Comments
 (0)
0