Re: (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
Дата
Msg-id CA+U5nMLdNmzxNR_55Dw_pYkAHQYnjiuU_zAWAXAA+BZ7WqhnFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: (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 Mon, Sep 12, 2011 at 8:19 AM, Toby Corkindale
<toby.corkindale@strategicdata.com.au> wrote:
> On 12/09/11 17:13, Simon Riggs wrote:
>>
>> On Mon, Sep 12, 2011 at 7:54 AM, Toby Corkindale
>>> What is the best method for determining whether you're connected to the
>>> master or slave database?
>>
>> SELECT pg_is_in_recovery();
>
>
> If I'm on a master database, which had previously crashed and is now in the
> process of recovery, won't that also return "true" there?


No, because you can't connect to the database during crash recovery,
so the first time you can connect to a has-crashed master it will
return false.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: Toby Corkindale
Дата:
Сообщение: 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