Re: Pg_ctl promote -- wait for slave to be promoted fully ?

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: Pg_ctl promote -- wait for slave to be promoted fully ?
Дата
Msg-id CAPTjJmo7DZ3AbHn0iDbRxSUn6zcmENriBra0ynhyp5VvCmtugw@mail.gmail.com
обсуждение исходный текст
Ответ на Pg_ctl promote -- wait for slave to be promoted fully ?  (Manoj Govindassamy <manoj@nimblestorage.com>)
Ответы Re: Pg_ctl promote -- wait for slave to be promoted fully ?  (Manoj Govindassamy <manoj@nimblestorage.com>)
Список pgsql-general
On Sat, Jul 21, 2012 at 5:28 AM, Manoj Govindassamy
<manoj@nimblestorage.com> wrote:
> -- Anyway I can query the state of DB to know its status slave or master ??
> So, that i can issue write statements only after I know that the DB is the
> new master now

Yep. Use pg_is_in_recovery() - it's false on the master, true on slaves.

http://www.postgresql.org/docs/9.1/static/functions-admin.html#FUNCTIONS-RECOVERY-INFO-TABLE

ChrisA

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

Предыдущее
От: Chris Angelico
Дата:
Сообщение: Re: Select Rows With Only One of Two Values
Следующее
От: Benjamin Adams
Дата:
Сообщение: Get DB Size by row