Simon Riggs wrote: > Attached is the patch I intend to commit, barring objections. > > This patch extends SIGINT to allow cancellation of transactions while > idle in both HS and normal mode.
How does AbortTransactionAndAnySubtransactions() differ from AbortOutOfAnyTransaction()? Having followed the discussions on this patch I think I know the answer: I'm guessing that AbortTransactionAndAnySubtransactions() leaves the backend in aborted state, while AbortOutOfAnyTransaction() leaves it in idle state. It would be good to point that out more clearly in the comment above AbortTransactionAndAnySubtransactions(). I agree with Joachim's comments upthread that we should have a different function for forcefully aborting the whole transaction, and leave the current pg_cancel_backend() behavior alone. In any case, the documentation of pg_cancel_backend() or the new function needs to explain what exactly it does. I believe people liked the idea of giving a different ERROR message when a transaction is canceled because of conflict with recovery. It would also be good to give a different error message when an idle transaction is canceled using query cancel. Otherwise you don't know what hit you, especially if you're not paying attention to NOTICEs. > It also changes the standard message > reported on an idle transaction in aborted state to '<IDLE> in > transaction (aborted)', so that once aborted we keep the message even if > the user tries to issue further statements other than ROLLBACK or > COMMIT. That's nice. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers