pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17.
3+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2024-11-04 e2a9129093 b1008c1f01  pg_basebackup, pg_receivewal: fix failure to find password in ~/.pgpass.
* BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17.
@ 2024-11-04 07:58 PG Bug reporting form <noreply@postgresql.org>
  2024-11-04 16:18 ` Re: BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17. Greg Sabino Mullane <htamfids@gmail.com>
  2024-11-04 19:40 ` Re: BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: PG Bug reporting form @ 2024-11-04 07:58 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: nuko.yokohama@gmail.com

The following bug has been logged on the website:

Bug reference:      18685
Logged by:          Toshi Harada
Email address:      nuko.yokohama@gmail.com
PostgreSQL version: 17.0
Operating system:   4.14.106-97.85.amzn2.x86_64
Description:        

Write the password for replication connection in the .pgpass file as
follows

$ cat ~/.pgpass
#hostname:port:database:username:password
127.0.0.1:16001:replication:repuser:repuser
127.0.0.1:17001:replication:repuser:repuser
$

In PostgreSQL 16, pg_basebackup could be run without prompting for a
password.

$ ~/pgsql/pgsql-16/bin/pg_basebackup -h 127.0.0.1 -p 16001 -U repuser -P -D
/tmp/bkup.dat
23638/23638 kB (100%), 1/1 tablespace
$

However, when running pg_basebacup on PostgreSQL 17, the user is prompted
for a password even if .pgpass is set.

$ ~/pgsql/pgsql-17/bin/pg_basebackup -h 127.0.0.1 -p 17001 -U repuser -P -D
/tmp/bkup.dat
Password:

Also, if the -w option is given, the following error occurs.

$ ~/pgsql/pgsql-17/bin/pg_basebackup -h 127.0.0.1 -p 17001 -w -U repuser -P
-D /tmp/bkup.dat
pg_basebackup: error: connection to server at "127.0.0.1", port 17001
failed: fe_sendauth: no password supplied
$

PostgreSQL 16's pg_basebackup does not get this error when the -w option is
given, and the password is completed by .pgpass

$ ~/pgsql/pgsql-16/bin/pg_basebackup -h 127.0.0.1 -p 16001 -U repuser -w -P
-D /tmp/bkup.dat
23638/23638 kB (100%), 1/1 tablespace
$

And inexplicably, PostgreSQL 17's pg_basebackup also does not prompt for a
password if -d “” is specified, and pg_basebackup can be executed.

$ ~/pgsql/pgsql-17/bin/pg_basebackup -h 127.0.0.1 -p 17001 -d "" -U repuser
-P -D /tmp/bkup.dat
23663/23663 kB (100%), 1/1 tablespace
$

We believe that the difference in behavior of pg_basebackup between
PostgreSQL 16 and PostgreSQL 17 when .pgpass is specified is problematic.

Best regards.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17.
  2024-11-04 07:58 BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17. PG Bug reporting form <noreply@postgresql.org>
@ 2024-11-04 16:18 ` Greg Sabino Mullane <htamfids@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Greg Sabino Mullane @ 2024-11-04 16:18 UTC (permalink / raw)
  To: nuko.yokohama@gmail.com; pgsql-bugs@lists.postgresql.org

Does changing the .pgpass like so work for you?

127.0.0.1:17001:*:repuser:repuser

Cheers,
Greg

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17.
  2024-11-04 07:58 BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17. PG Bug reporting form <noreply@postgresql.org>
@ 2024-11-04 19:40 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2024-11-04 19:40 UTC (permalink / raw)
  To: nuko.yokohama@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> In PostgreSQL 16, pg_basebackup could be run without prompting for a
> password.
> However, when running pg_basebacup on PostgreSQL 17, the user is prompted
> for a password even if .pgpass is set.

Yup, that's a bug.  Fix pushed, thanks for the report!

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-11-04 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-04 07:58 BUG #18685: .pgpass is not enabled when running pg_basebackup on PostgreSQL 17. PG Bug reporting form <noreply@postgresql.org>
2024-11-04 16:18 ` Greg Sabino Mullane <htamfids@gmail.com>
2024-11-04 19:40 ` Tom Lane <tgl@sss.pgh.pa.us>

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