Re: Determine if postgresql cluster running is primary or not

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Determine if postgresql cluster running is primary or not
Дата
Msg-id f09b2f94-d9a5-473c-d726-7e1aa53a7e94@gmx.net
обсуждение исходный текст
Ответ на Determine if postgresql cluster running is primary or not  (Raul Kaubi <raulkaubi@gmail.com>)
Ответы Re: Determine if postgresql cluster running is primary or not  (Paul Förster <paul.foerster@gmail.com>)
Список pgsql-general
Raul Kaubi schrieb am 20.11.2020 um 09:53:
> CentOS 7
> Postgres 9 to 12
>
> For monitoring purpose, I would like that certain scripts are only run in primary server.
> So I am looking ways to universally discover if postgresql cluster that is running is primary or not.

As the standby will be in constant recovery, you can use

   select pg_is_in_recovery();




В списке pgsql-general по дате отправления:

Предыдущее
От: Raul Kaubi
Дата:
Сообщение: Determine if postgresql cluster running is primary or not
Следующее
От: Paul Förster
Дата:
Сообщение: Re: Determine if postgresql cluster running is primary or not