Re: how to tell master from replica

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: how to tell master from replica
Дата
Msg-id CAB7nPqStjkHBpLyVB_63bVNwyNd_tWM9YDLRgUWuD-GyN-G5Eg@mail.gmail.com
обсуждение исходный текст
Ответ на how to tell master from replica  (Scott Ribe <scott_ribe@elevated-dev.com>)
Ответы Re: how to tell master from replica  (Scott Ribe <scott_ribe@elevated-dev.com>)
Список pgsql-general
On Thu, Sep 26, 2013 at 8:53 AM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> Assuming a master & replica set up using streaming replication, hot standby, 9.3.
>
> I'd like to have a single script on both machines distinguish whether it's running on the machine with the master or
replica,and take different actions accordingly. 
>
> Is the way to do this to check for the presence of wal sender process vs wal receiver process? Or is there a query
thatcould executed against sys tables to find current running config of the local postmaster? 
"SELECT pg_is_in_recovery();" can be used to make the difference
between a master and a slave.
--
Michael


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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: how to tell master from replica
Следующее
От: bricklen
Дата:
Сообщение: Re: how to tell master from replica