aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r--src/bin/psql/startup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 67653ae75f8..2f870921ed3 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -416,7 +416,9 @@ main(int argc, char *argv[])
if (options.single_txn)
{
- if ((res = PSQLexec("COMMIT")) == NULL)
+ res = PSQLexec((successResult == EXIT_SUCCESS) ?
+ "COMMIT" : "ROLLBACK");
+ if (res == NULL)
{
if (pset.on_error_stop)
{