Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.
Date
Msg-id CAB7nPqQARGdXE2kzeJKzFhd1QiwZzmwUPH4xPw76_snxyBA+KA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.  (Elvis Pranskevichus <elprans@gmail.com>)
Responses Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.  (Elvis Pranskevichus <elprans@gmail.com>)
List pgsql-hackers
On Sat, Mar 18, 2017 at 2:56 AM, Elvis Pranskevichus <elprans@gmail.com> wrote:
> Currently, clients wishing to know when the server exits hot standby
> have to resort to polling, which is often suboptimal.
>
> This adds the new "in_hot_standby" GUC variable that is reported via a
> ParameterStatus message.  This allows the clients to:
>
>    (a) know right away that they are connected to a server in hot
>        standby; and
>
>    (b) know immediately when a server exits hot standby.
>
> This change will be most beneficial to various connection pooling
> systems (pgpool etc.)

Why adding a good chunk of code instead of using pg_is_in_recovery(),
which switches to false once a server exits recovery?
-- 
Michael



pgsql-hackers by date:

Previous
From: Erik Rijkers
Date:
Subject: Re: [HACKERS] more on comments of snapbuild.c
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] pageinspect and hash indexes