Re: Change pg_cancel_*() to ignore current backend

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change pg_cancel_*() to ignore current backend
Date: 2015-05-20 02:19:43
Message-ID: CAFcNs+pmna0FpOzdV1itZ+PXdbmxaU7CMa42JZnnJAD=Mq=hSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em terça-feira, 19 de maio de 2015, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
escreveu:

> On 5/19/15 6:30 PM, David G. Johnston wrote:
>
>> On Tue, May 19, 2015 at 4:23 PM, Marko Tiikkaja <marko(at)joh(dot)to
>> <mailto:marko(at)joh(dot)to>>wrote:
>>
>> On 2015-05-20 00:59, Jim Nasby wrote:
>>
>> I find it annoying to have to specifically exclude
>> pg_backend_pid() from
>> pg_stat_activity if I'm trying to kill a bunch of backends at
>> once, and
>> I can't think of any reason why you'd ever want to call a
>> pg_cancel_*
>> function with your own PID.
>>
>>
>> That's a rather easy way of testing that you're handling FATAL
>> errors correctly from a driver/whatever.
>>
>>
>> I'm having trouble thinking of a PC name for the function we create that
>> should do this; while changing the pg_cancel_* functions to operate more
>> safely.
>>
>
> We could add a second parameter to the current functions: allow_own_pid
> DEFAULT false. To me that seems better than an entirely separate set of
> functions.
>
>
+1 to add a second parameter to current functions.

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-20 03:14:31 Re: Back-branch update releases planned for next week
Previous Message Stephen Frost 2015-05-20 02:17:55 Re: RFC: Non-user-resettable SET SESSION AUTHORISATION