Re: Replication

From: Bertrand Paquet <bertrand(dot)paquet(at)doctolib(dot)fr>
To: Vik Fearing <vik(at)2ndquadrant(dot)fr>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Replication
Date: 2016-06-06 08:53:32
Message-ID: CAN1xZsf5tnDn5v0q_uy3LOzBiHcs_FRykn7AFEr_Dxw3r3oirg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Thx you for answering.

Regards,

Bertrand

2016-06-06 10:22 GMT+02:00 Vik Fearing <vik(at)2ndquadrant(dot)fr>:

> On 06/06/16 09:54, Masahiko Sawada wrote:
> > On Sat, Jun 4, 2016 at 10:58 PM, Vik Fearing <vik(at)2ndquadrant(dot)fr> wrote:
> >> 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.
> >
> > It might not be a right way but how about using pg_read_file()?
> > postgres(1)=# select regexp_replace(pg_read_file('recovery.conf'),
> > '.*primary_conninfo = (.*)', '\1');
> > regexp_replace
> > ---------------------------------------------------
> > 'host=localhost port=5550 application_name=node1'+
> >
> > (1 row)
> >
> > You can get the master server information via SQL from standby server.
>
> This is a good idea, but suffers the same problem that Bertrand has with
> looking at the file a different way: if the file was changed but the
> standby server has not been restarted, it's (potentially) not going to
> be the correct information.
> --
> Vik Fearing +33 6 46 75 15 36
> http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rick Widmer 2016-06-06 08:55:35 ALTER TABLE and vacuum
Previous Message Vik Fearing 2016-06-06 08:22:50 Re: Replication