Re: Detecting master/slave

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Detecting master/slave
Date: 2014-11-21 14:19:59
Message-ID: m4nhmf$e5t$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Pribyl schrieb am 21.11.2014 um 15:13:
> Is there a better/recommended way to determine which host in a
> cluster is the master or slave besides rescue.conf or
> pg_stat_replication?
>
> Just looking for the "right" way to know which
> host is which.

What about

select pg_is_in_recovery()

should return true on the slave and false on the master.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sameer Kumar 2014-11-21 14:39:40 Re: Detecting master/slave
Previous Message Nitesh Gupta 2014-11-21 14:18:09 Re: Detecting master/slave