Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 21, 2012 at 5:28 AM, Manoj Govindassamy
<manoj@xxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux