Re: SR slaves and .pgpass

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SR slaves and .pgpass
Date: 2010-06-07 15:42:05
Message-ID: 16728.1275925325@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> On Mon, Jun 7, 2010 at 5:42 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> I tried this with a database name of "replication" in the .pgpass file,
>> which matches what we need to use in pg_hba.conf, but it failed miserably,
>> and only worked when I used a wildcard for the database name in the .pgpass
>> file.
>>
>> If this is expected it needs to be documented more clearly; if not, it's a
>> bug.

> Yep, this is expected, so we need to improve the doc.

Why don't we improve the code, instead? In particular make
libpqrcv_connect() do

- snprintf(conninfo_repl, sizeof(conninfo_repl), "%s replication=true", conninfo);
+ snprintf(conninfo_repl, sizeof(conninfo_repl), "%s database=replication replication=true", conninfo);

I don't think it's unlikely that someone would try to enter a
replication-specific password into ~/.pgpass.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-06-07 15:45:18 Re: Re: [COMMITTERS] pgsql: Add current WAL end (as seen by walsender, ie, GetWriteRecPtr()
Previous Message Dean Rasheed 2010-06-07 15:17:55 Re: Invalid YAML output from EXPLAIN