Re: Replication - Mailing list pgsql-general

From Vik Fearing
Subject Re: Replication
Date
Msg-id 5752DE6A.7010706@2ndquadrant.fr
Whole thread Raw
In response to Replication  (Bertrand Paquet <bertrand.paquet@doctolib.fr>)
Responses Re: Replication  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-general
On 02/06/16 15:32, Bertrand Paquet wrote:
> Hi,
>
> On an hot standby streaming server, is there any way to know, in SQL, to
> know the ip of current master ?

No.

> The solution I have is to read the recovery.conf file to find
> primary_conninfo,

That is currently the only solution.  There are plans to allow SQL
access to the parameters in recovery.conf (or to merge them into
postgresql.conf) but that's not currently possible.

> but, it can be false.

It would only be wrong if recovery.conf has been edited since the stanby
was last restarted.

There are hooks for connections and disconnections of the walreceiver,
so it should be possible and fairly simple to write an extension that
remembers and exposes the primary_conninfo in effect.
--
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-general by date:

Previous
From: Andrew Beverley
Date:
Subject: Re: Actual rows significantly more than estimated during many joins
Next
From: Vik Fearing
Date:
Subject: Re: Replication