Re: [PATCH] V3: Idle in transaction cancellation - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PATCH] V3: Idle in transaction cancellation
Date
Msg-id AANLkTingz_VF7JKc5A+EoXPjsiXdTnRJXHDiyAcsKW6d@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] V3: Idle in transaction cancellation  (Andres Freund <andres@anarazel.de>)
Responses Re: [PATCH] V3: Idle in transaction cancellation  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sat, Oct 30, 2010 at 4:49 AM, Andres Freund <andres@anarazel.de> wrote:
>> > Here is a proposed patch which enables cancellation of $subject.

Disclaimer: This isn't my area of expertise, so take the below with a
grain or seven of salt.

It sort of looks to me like the LOG_NO_CLIENT error flag and the
silent_error_while_idle flag are trying to cooperate to get the effect
of throwing an error without actually throwing an error.  I'm
wondering if it would be at all sensible to do that more directly by
making ProcessInterrupts() call AbortCurrentTransaction() in this
case.

Assuming that works at all, it would presumably mean that the client
would thereafter get something like this:

current transaction is aborted, commands ignored until end of transaction block

...which might be thought unhelpful.  But that could be fixed either
by modifying errdetail_abort() or perhaps even by abstracting the
"current transaction is aborted, commands..." message into a function
that could produce an entirely different message if on either the
first or all calls within a given transaction.

I'm not sure if this would work, or if it's better.  I'm just throwing
it out there, because the current approach looks a little grotty to
me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: James William Pye
Date:
Subject: Re: hstores in pl/python
Next
From: Josh Berkus
Date:
Subject: Re: ALTER TABLE ... REPLACE WITH