Re: Change pg_cancel_*() to ignore current backend

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Change pg_cancel_*() to ignore current backend
Дата
Msg-id 555BDDEA.3040300@BlueTreble.com
обсуждение исходный текст
Ответ на Re: Change pg_cancel_*() to ignore current backend  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Change pg_cancel_*() to ignore current backend  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Список pgsql-hackers
On 5/19/15 6:30 PM, David G. Johnston wrote:
> On Tue, May 19, 2015 at 4:23 PM, Marko Tiikkaja <marko@joh.to
> <mailto:marko@joh.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.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: upper planner path-ification