Re: psql CLI: warn about ongoing transaction on exit

From: "Neil Conway" <neilc(at)samurai(dot)com>
To: "Martin Pitt" <martin(at)piware(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: psql CLI: warn about ongoing transaction on exit
Date: 2007-09-18 06:15:58
Message-ID: 1294.76.225.157.205.1190096158.squirrel@76.225.157.205
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-09-18 14:51:00 Re: psql CLI: warn about ongoing transaction on exit
Previous Message Martin Pitt 2007-09-18 06:00:58 Re: psql CLI: warn about ongoing transaction on exit