pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@2ndquadrant.fr>
To: Bertrand Paquet <bertrand.paquet@doctolib.fr>
To: pgsql-general@postgresql.org
Subject: Re: Replication
Date: Sat, 4 Jun 2016 15:58:02 +0200
Message-ID: <5752DE6A.7010706@2ndquadrant.fr> (raw)
In-Reply-To: <CAN1xZseiqNRh1ZE0seVk7UuHeWvFBEWG+FcW7Xfm_Nv=d+fPGw@mail.gmail.com>
References: <CAN1xZseiqNRh1ZE0seVk7UuHeWvFBEWG+FcW7Xfm_Nv=d+fPGw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (131+ messages)  latest in thread

Message-ID: <5752DE6A.7010706@2ndquadrant.fr>
Permalink:  ../5752DE6A.7010706@2ndquadrant.fr/
Also on:    postgresql.org/message-id/5752DE6A.7010706@2ndquadrant.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: vik@2ndquadrant.fr, bertrand.paquet@doctolib.fr
  Subject: Re: Replication
  In-Reply-To: <5752DE6A.7010706@2ndquadrant.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox