Re: Determine if postgresql cluster running is primary or not

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
Cc: Thomas Kellerer <shammat(at)gmx(dot)net>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Determine if postgresql cluster running is primary or not
Date: 2020-11-20 09:34:04
Message-ID: CAKFQuwbWCe+sQhR+Xg9Rz3Eh-0kTYD3x4+Tx9paAFntcNKeRLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, November 20, 2020, Paul Förster <paul(dot)foerster(at)gmail(dot)com> wrote:
>
>
> > On 20. Nov, 2020, at 10:03, Thomas Kellerer <shammat(at)gmx(dot)net> wrote:
>
> >
> > select pg_is_in_recovery();
>
> I usually don't recommend using pg_is_in_recovery() only because a
> database cluster can be in recovery for other reasons. This is why I always
> do the following:
>

Do any of those other reasons allow connections that could execute that
function to exist?

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zwettler Markus (OIZ) 2020-11-20 09:38:38 AW: Linux package upgrade without dependency conflicts
Previous Message Paul Förster 2020-11-20 09:28:55 Re: Determine if postgresql cluster running is primary or not