aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 392b96eb862..ce180e1cd7b 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -412,7 +412,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)
{