Improve handling of ^C in psql / top-level transaction abort

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Improve handling of ^C in psql / top-level transaction abort
Date: 2016-08-15 00:30:23
Message-ID: d459f527-7ce1-f2ef-e027-85c629af6c0f@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I recently had a client contact me thinking that a CREATE MATERIALIZED
VIEW had somehow managed to keep running in the background after being
^C'd in psql. Turns out this confusion was because their monitoring
eventually complained about the still open (but now aborted)
transaction. The user didn't realize that ^C of a command in an open
transaction would still leave the transaction open.

I'm wondering if there's some way to improve this. One idea is if
TBLOCK_INPROGRESS could also do some of what CleanupTransaction() does
but still leave the status in TBLOCK_ABORT. In particular, release
snapshots. Since there's no substransaction, there's no possibility of
running further commands. Is there risk to that with portals still open?
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-08-15 00:57:55 Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Previous Message Joy Arulraj 2016-08-14 23:40:40 Re: C++ port of Postgres