Re: postgres in streaming replication mode

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Megan <nagemnna(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: postgres in streaming replication mode
Date: 2013-11-19 13:09:24
Message-ID: CAHGQGwEXbsABN5G_JHweJohh2H10H-4hcUjZgz3eb6WED=QG6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Nov 19, 2013 at 10:01 PM, Megan <nagemnna(at)gmail(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message bricklen 2013-11-19 14:25:44 Re: Postgresql not accessible, recovering
Previous Message Megan 2013-11-19 13:01:25 postgres in streaming replication mode