Skip to content

Commit

Permalink
fix(postgres): fix pg_isready issue with empty listen_addresses
Browse files Browse the repository at this point in the history
This commit resolves the issue where `pg_isready` would fail when
`socketDir` is set and `listen_addresses` is empty. `pg_isready` is now
modified to leverage `socketDir` when it is available.
  • Loading branch information
johnhampton committed Apr 12, 2024
1 parent 04b5f77 commit e4d8770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nix/postgres/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ in
'';
};
pg_isreadyArgs = [
"-h ${config.listen_addresses}"
(if config.socketDir != "" then "-h $(readlink -f \"${config.socketDir}\")" else "-h ${config.listen_addresses}")
"-p ${toString config.port}"
"-d template1"
] ++ (lib.optional (config.superuser != null) "-U ${config.superuser}");
Expand Down

0 comments on commit e4d8770

Please sign in to comment.