Skip site navigation (1) Skip section navigation (2)

Re: pg_primary_conninfo

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_primary_conninfo
Date: 2010-12-28 15:04:56
Message-ID: AANLkTimXXko1OJDTrT8LU=5GxtUcL7C0mNgqaOC-DnX1@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Dec 28, 2010 3:58 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > Attached patch implements a function called pg_primary_conninfo() that
> > returns, well, the primary_conninfo used on the standby when in
> > streaming replication mode (otherwise NULL).
>
> > Objections?
>
> What's the use case?  And aren't there security reasons to NOT expose
> that?  It might contain a password for instance.

Good point - should be made superuser only.
>

> > +     if (recptr.xlogid == 0 && recptr.xrecoff == 0 && conninfo[0] !=
'\0')
> > +             PG_RETURN_NULL();
>
> This test seems a bit incoherent.

I used that to test that streaming repl is enabled at all. Is there a better
way?

/Magnus

In response to

Responses

pgsql-hackers by date

Next:From: Gurjeet SinghDate: 2010-12-28 15:09:51
Subject: Re: small table left outer join big table
Previous:From: Tom LaneDate: 2010-12-28 14:58:28
Subject: Re: pg_primary_conninfo

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group