Re: [PATCH] pg_reload_backend to signal SIGHUP to a specific backend

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pg_reload_backend to signal SIGHUP to a specific backend
Date: 2017-06-29 06:18:53
Message-ID: 20170629151853.b23c3cf9.nagata@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 28 Jun 2017 13:35:12 +0200
Dmitry Dolgov <9erthalion6(at)gmail(dot)com> wrote:

> > On 28 June 2017 at 12:17, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> >
> > Hi,
> >
> > Attached is a patch of pg_reload_backend that is a function signaling
> > SIGHUP to a specific backend. The original idea is from Michael
> Paquier[1].
> > The documatation isn't included in this patch yet.
>
> I have few questions. I'm curious, why this function returns something
> different from bool when I'm passing null as an argument?

This is because this function is defined as strict, that is pg_proc.proisstrict
is true, as well as pg_reload_conf, pg_terminate_backend, pg_cancel_bacnend, and so on.

>
> =# select pg_reload_backend(27961);
> WARNING: PID 27961 is not a PostgreSQL server process
> WARNING: failed to send signal to backend: 27961
> pg_reload_backend
> -------------------
> f
> (1 row)
>
> =# select pg_reload_backend(27962);
> pg_reload_backend
> -------------------
> t
> (1 row)
>
> =# select pg_reload_backend(null);
> pg_reload_backend
> -------------------
>
> (1 row)
>
> Also for some reason I can't grant an execute permission on this function,
> am I doing something wrong?
>
> =# grant execute on function pg_reload_backend() to test_user;
> ERROR: function pg_reload_backend() does not exist
> =# grant execute on function pg_reload_conf() to test_user;
> GRANT

Arg type is needed.

=# grant execute on function pg_reload_backend(int) to test_user;

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2017-06-29 06:49:20 Re: [PATCH] pg_reload_backend to signal SIGHUP to a specific backend
Previous Message Amit Langote 2017-06-29 05:08:27 Re: asynchronous execution