I'm running postgres 9.2.5 with streaming replication. Is there a way to tell which database is the master other then the presence or lack of presence of the recovery.conf file?
On Tue, Nov 19, 2013 at 10:01 PM, Megan <nagemnna@gmail.com> wrote:
> Good day all,
>
> I'm running postgres 9.2.5 with streaming replication. Is there a way to
> tell which database is the master other then the presence or lack of
> presence of the recovery.conf file?
You can use pg_is_in_recovery().
http://www.postgresql.org/docs/devel/static/functions-admin.html#FUNCTIONS-RECOVERY-CONTROL
This function returns false in the master, but returns true in the standby.
Regards,
--
Fujii Masao
Есть вопросы? Напишите нам!
✖
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера