Dan Langille: I figured out why pg_dump was failing with PostgreSQL 15-16
原文英文,约100词,阅读约需1分钟。发表于: 。In recent blog post, I outlined a problem I hit with pg_dump. Specifically, pg_dump was picking up and using ~/.pgpass with pg_dump from PostgreSQL 12-14, but with PostgreSQL 15-16, it was failing. In this blog post: FreeBSD 13.2 PostgreSQL server 12 / 16 PostgreSQL client 12-16 Bacula 9.6.7 Today we figured out why: $HOME. $HOME for the script was set to / In PostgreSQL < 15, the code used the database to determine HOME and then pick up ~/.pgpass Stumbling through the environment variables In PostgreSQL 16, the code first checks $HOME (as shown in this commit). The order is now: PGPASSFILE $HOME/.pgpass (starting with v15) ~/.pgpass (i.e. the home directory from /etc/passwd) I stumbled across the problem this morning when pg_dump wasn’t running with a 16 client against a 16 server. The output was: 22-Nov 13:36 bacula-dir JobId 361250: Start Backup JobId 361250, Job=BackupCatalog.2023-11-22_13.36.38_39 22-Nov 13:36 bacula-dir JobId 361250: There are no more Jobs associated with Volume "FullAutoNoNextPool-04-17758". Marking it purged. 22-Nov 13:36 bacula-dir JobId 361250: All records pruned from Volume "FullAutoNoNextPool-04-17758"; marking it "Purged" 22-Nov 13:36 bacula-dir JobId 361250: Recycled volume "FullAutoNoNextPool-04-17758" 22-Nov 13:36 bacula-dir JobId 361250: Using Device "vDrive-FullFileNoNextPool-0" to write. 22-Nov 13:36 dbclone-fd JobId 361250: shell command: run ClientRunBeforeJob "/usr/local/bacula/dump_catalog.sh" 22-Nov 13:36 dbclone-fd JobId 361250: ClientRunBeforeJob: Password: 22-Nov 13:36 dbclone-fd JobId 361250: ClientRunBeforeJob: pg_dump: error: connection to server at "pg03.int.unixathome.org" (10.55.0.34), port 5432 failed: fe_sendauth: no password supplied 22-Nov 13:36 bacula-sd-04 JobId 361250: Recycled volume "FullAutoNoNextPool-04-17758" on File device "vDrive-FullFileNoNextPool-0" (/usr/local/bacula/volumes/FullFileNoNextPool), all previous data lost. 22-Nov 13:36 bacula-dir JobId 3612[...]
这篇文章没有提供任何内容。