Re: Terminating a backend - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Terminating a backend
Date
Msg-id 6402.1205171865@sss.pgh.pa.us
Whole thread Raw
In response to Re: Terminating a backend  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Terminating a backend
Re: Terminating a backend
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Bruce Momjian wrote:
>> When we get the termination signal, why can't we just set a global
>> boolean, do a query cancel, and in the setjmp() code block check the
>> global and exit --- at that stage we know we have released all locks and
>> can exit cleanly.

> Should I add this as a TODO?  Seems so.  Tom commented in the patches
> queue that it will not work but I don't understand why.

The problem with treating it like elog(ERROR) is that you're at the
mercy of user-defined code as to whether you'll actually exit or not.
UDFs can trap elog(ERROR).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Terminating a backend
Next
From: Alvaro Herrera
Date:
Subject: Re: Terminating a backend