Re: Replication

From: Vik Fearing <vik(at)2ndquadrant(dot)fr>
To: Bertrand Paquet <bertrand(dot)paquet(at)doctolib(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Replication
Date: 2016-06-04 13:58:02
Message-ID: 5752DE6A.7010706@2ndquadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Replication at 2016-06-02 13:32:32 from Bertrand Paquet

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vik Fearing 2016-06-04 13:59:40 Re: Replication
Previous Message Andrew Beverley 2016-06-04 12:18:58 Re: Actual rows significantly more than estimated during many joins