Re: psql CLI: warn about ongoing transaction on exit - Mailing list pgsql-bugs

From Neil Conway
Subject Re: psql CLI: warn about ongoing transaction on exit
Date
Msg-id 1294.76.225.157.205.1190096158.squirrel@76.225.157.205
Whole thread Raw
In response to Re: psql CLI: warn about ongoing transaction on exit  (Martin Pitt <martin@piware.de>)
List pgsql-bugs
Martin Pitt said:
> If you just output a rollback command on exit, then it is already too
> late to rescue the pending transaction, so I'm not sure whether that
> would help this use case so much.

Well, the DBA can always replay the transaction manually -- I think
notifying the DBA that their modifications have been discarded
is actually more important. Presumably this isn't a particularly
common case...

> What do you think about displaying a different prompt when a
> transaction is pending, like showing the number of open transactions
> in parentheses or so?

Well, there can be at most one active transaction associated with
a given database session. In any case, this feature already exists:
see the %x escape sequence for the PROMPT[1-3] psql variables.

-Neil

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: Re: psql CLI: warn about ongoing transaction on exit
Next
From: "Jarl Petter Kvalsvik"
Date:
Subject: Re: BUG #2881: FATAL: could not reattach to shared memory (Win32)