Re: [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Elvis Pranskevichus <elprans(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.
Date: 2017-03-18 07:33:16
Message-ID: CAB7nPqQARGdXE2kzeJKzFhd1QiwZzmwUPH4xPw76_snxyBA+KA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 18, 2017 at 2:56 AM, Elvis Pranskevichus <elprans(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-03-18 08:01:58 Re: pageinspect and hash indexes
Previous Message Erik Rijkers 2017-03-18 05:47:51 Re: more on comments of snapbuild.c