pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Kristjan Mustkivi <sonicmonkey@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: CREATE SUBSCRIPTION not picking up .pgpass while psql does
Date: Wed, 31 Aug 2022 15:07:20 +0200
Message-ID: <20220831130720.GA18978@depesz.com> (raw)
In-Reply-To: <CAOQPKattt3g2dEKqiC9qdp4bxAHWipVO5fWy0En8MT9aw5SKmA@mail.gmail.com>
References: <CAOQPKattt3g2dEKqiC9qdp4bxAHWipVO5fWy0En8MT9aw5SKmA@mail.gmail.com>

On Wed, Aug 31, 2022 at 04:03:31PM +0300, Kristjan Mustkivi wrote:
> Hello,
> 
> I do not understand why CREATE SUBSCRIPTION does not pick up .pgpass
> (when psql does):
> 
> root@pg.newtest:/# psql 'host=pg.oldtest port=5432 user=pg_replication
> dbname=oldtest'
> oldtest=# \q
> 
> root@pg.newtest:/# psql newtest postgres
> newtest=# CREATE SUBSCRIPTION sub_pgupgrade CONNECTION
> 'host=pg.oldtest port=5432 user=pg_replication dbname=oldtest'
> PUBLICATION pub_pgupgrade;
> ERROR:  could not connect to the publisher: connection to server at
> "pg.oldtest" (x.x.x.x), port 5432 failed: fe_sendauth: no password
> supplied
> newtest=#
> 
> oldtest is 11.15 (Debian 11.15-1.pgdg90+1)
> newtest is 14.5 (Debian 14.5-1.pgdg110+1)
> 
> .pgpass is under /root (home inside the docker container) with 0600
> permissions and owned by user "postgres". Even providing
> passfile=/root/.pgpass in the connstring does not work.

How/where you provide it?

Why would you assume that postgres (running from user postgres
presumably) would look for pgpass in /root/.pgpass?

postgres should have it in ~postgres/.pgpass
with proper ownership.

depesz





view thread (5+ messages)  latest in thread

Message-ID: <20220831130720.GA18978@depesz.com>
Permalink:  ../20220831130720.GA18978@depesz.com/
Also on:    postgresql.org/message-id/20220831130720.GA18978@depesz.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, sonicmonkey@gmail.com
  Subject: Re: CREATE SUBSCRIPTION not picking up .pgpass while psql does
  In-Reply-To: <20220831130720.GA18978@depesz.com>
  References: <CAOQPKattt3g2dEKqiC9qdp4bxAHWipVO5fWy0En8MT9aw5SKmA@mail.gmail.com> <20220831130720.GA18978@depesz.com>

* 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