Skip to content

Commit c2b3209

Browse files
committed
allow force-quit if a transaction is running
Signed-off-by: maximsmol <1472826+maximsmol@users.noreply.github.com>
1 parent c84d913 commit c2b3209

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pgcli/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def _check_ongoing_transaction_and_allow_quitting(self):
926926
while 1:
927927
try:
928928
choice = click.prompt(
929-
"A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit.",
929+
"A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit, `force` to exit anyway.",
930930
default="a",
931931
)
932932
except click.Abort:
@@ -938,6 +938,8 @@ def _check_ongoing_transaction_and_allow_quitting(self):
938938
choice = choice.lower()
939939
if choice == "a":
940940
return False # do not quit
941+
if choice == "force":
942+
return True # quit anyway
941943
if choice == "c":
942944
query = self.execute_command("commit")
943945
return query.successful # quit only if query is successful

0 commit comments

Comments
 (0)