Re: How to know killed by pg_terminate_backend
От
Tatsuo Ishii
Тема
Re: How to know killed by pg_terminate_backend
Дата
Msg-id
20100514.092043.71478914.t-ishii@sraoss.co.jp
Ответ на
Re: How to know killed by pg_terminate_backend (Heikki Linnakangas)
Список
Дерево обсуждения
How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
Re: How to know killed by pg_terminate_backend Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
Re: How to know killed by pg_terminate_backend Robert Haas <robertmhaas@gmail.com>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@sraoss.co.jp>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
Re: How to know killed by pg_terminate_backend Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: How to know killed by pg_terminate_backend Tom Lane <tgl@sss.pgh.pa.us>
Re: How to know killed by pg_terminate_backend Robert Haas <robertmhaas@gmail.com>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
Re: How to know killed by pg_terminate_backend Tom Lane <tgl@sss.pgh.pa.us>
Re: How to know killed by pg_terminate_backend Tatsuo Ishii <ishii@postgresql.org>
> > Maybe we could make PostgreSQL a little bit smarter so that it returns
> > a different code than 57P01 when killed by pg_terminate_backend().
>
> Seems reasonable. Does the victim backend currently know why it has been
> killed?
I don't think so.
One idea is postmaster sets a flag in the shared memory area
indicating it rceived SIGTERM before forwarding the signal to
backends.
Backend check the flag and if it's not set, it knows that the signal
has been sent by pg_terminate_backend(), not postmaster.
What about new error code:
#define ERRCODE_BACKEND_STOP_REQUEST MAKE_SQLSTATE('5','7', 'P','0','4')
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата: