Thread: How to find out if the server is postgres slave ??
From command line, is there any way to find out if the server is actually a slave server not master ?? I am writing some script, so for sanity check purpose , i need to know if the server the server i am on , its actually slave thanks for your help. -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-find-out-if-the-server-is-postgres-slave-tp5730418.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
Hi ,
We can use pg_is_in_recovery() command to check whether the server is in recovery or not.
I believe, we can get this information from pg_controldata's "database cluster state" as well.
I believe, we can get this information from pg_controldata's "database cluster state" as well.
Best Regards,
Dinesh
manojadinesh.blogspot.com
On Fri, Nov 2, 2012 at 3:36 AM, expertalert <expertalert@gmail.com> wrote:
From command line, is there any way to find out if the server is actually a
slave server not master ??
I am writing some script, so for sanity check purpose , i need to know if
the server the server i am on , its actually slave
thanks for your help.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-find-out-if-the-server-is-postgres-slave-tp5730418.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On Fri, Nov 2, 2012 at 9:06 AM, expertalert <expertalert@gmail.com> wrote: > > From command line, is there any way to find out if the server is actually a > slave server not master ?? > > I am writing some script, so for sanity check purpose , i need to know if > the server the server i am on , its actually slave > > thanks for your help. select pg_is_in_recovery() If it's true, you're on a slave; if false, master. ChrisA