Re: Queries Regarding Postgresql Replication

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Nithya Rajendran <r-nithya(at)hcl(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Queries Regarding Postgresql Replication
Date: 2011-05-06 02:28:01
Message-ID: BANLkTi=YiPZgBaXsOBOJoAkJs0eh3DMZbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 5, 2011 at 7:33 AM, Nithya Rajendran <r-nithya(at)hcl(dot)com> wrote:

[Disclaimer: I have minimal experience with hot standby, the below is
just from reading the docs]

> ===> How to find whether current postgres is running as master or slave?

SELECT pg_is_in_recovery();
will tell you (should be false for the master, true for the slave).

> ====> What is the procedure to make the failed master as working slave?

You mean, after you've failed over from A to B, how to bring A back up
as a slave of B? You should be able to just follow the steps of
setting up a master-slave pair, with B as the new master, and A the
new slave.

Josh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Cheng 2011-05-06 03:03:28 Re: Cannot reproduce why a query is slow
Previous Message Toby Corkindale 2011-05-06 02:02:12 Re: Fwd: Re: SSDD reliability