Re: How to find out if the server is postgres slave ?? - Mailing list pgsql-general

From Chris Angelico
Subject Re: How to find out if the server is postgres slave ??
Date
Msg-id CAPTjJmq8uHr+4Bf5u-W6S-T7nt0OrUZ0kAUOtpUD-GQX2X6jow@mail.gmail.com
Whole thread Raw
In response to How to find out if the server is postgres slave ??  (expertalert <expertalert@gmail.com>)
List 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


pgsql-general by date:

Previous
From: dinesh kumar
Date:
Subject: Re: How to find out if the server is postgres slave ??
Next
From: dinesh kumar
Date:
Subject: Re: Postgresql - 8.3 Replication in windows