Re: (replication) Detecting if server a slave, or a master in recovery

Поиск
Список
Период
Сортировка
От Toby Corkindale
Тема Re: (replication) Detecting if server a slave, or a master in recovery
Дата
Msg-id 4E6DB041.5080606@strategicdata.com.au
обсуждение исходный текст
Ответ на (replication) Detecting if server a slave, or a master in recovery  (Toby Corkindale <toby.corkindale@strategicdata.com.au>)
Ответы Re: (replication) Detecting if server a slave, or a master in recovery
Список pgsql-general
On 12/09/11 16:54, Toby Corkindale wrote:
> Hi,
> What is the correct way to tell what mode a replicated Pg server is
> currently in, via a database connection?
>
> I can take a guess if it's the master or a slave by using the
> pg_current_xlog_location() and pg_last_xlog_replay_location() functions.
>
> However it occurs to me that a master server, which has been roughly
> rebooted and is replaying its WAL files will probably give the same
> response as a slave, when I call the current_xlog_location().
>
>
> What is the best method for determining whether you're connected to the
> master or slave database?


It's disappointing that I can't query standby_mode in psql.
ie.
SHOW standby_mode;

Toby

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

Предыдущее
От: Toby Corkindale
Дата:
Сообщение: (replication) Detecting if server a slave, or a master in recovery
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: (replication) Detecting if server a slave, or a master in recovery