Closed johnhampton closed 6 months ago
Shoudn't this be done at a level close to the option def?
I doubt that is possible here, because then we would expect pg_isready
to automatically detect, which amongst unix_socket_directories
or listen_addresses
to choose from based on postgresql.conf
but don’t think that is supported: https://www.postgresql.org/docs/current/app-pg-isready.html
@johnhampton could you also add a basic test services.postgres.”pg3”
, that would test for empty listen_addresses
and non-empty socketDir
?
You can add the test here: https://github.com/juspay/services-flake/blob/main/nix/postgres/postgres_test.nix
@johnhampton could you also add a basic test
services.postgres.”pg3”
, that would test for emptylisten_addresses
and non-emptysocketDir
?You can add the test here: https://github.com/juspay/services-flake/blob/main/nix/postgres/postgres_test.nix
@shivaraj-bh done.
Shoudn't this be done at a level close to the option def? Maybe:
@srid I'm not sure, I followed the code just above my change.
I doubt that is possible here, because then we would expect pg_isready to automatically detect, which amongst unix_socket_directories or listen_addresses to choose from based on postgresql.conf but don’t think that is supported: https://www.postgresql.org/docs/current/app-pg-isready.html
And primarily that is because the settings above (postgresql.conf
) only applies to the server and not the client CLI utils.
I couldn’t find any documentation on the clients picking up configs from postgresql.conf
, but did for the server: https://www.postgresql.org/docs/current/config-setting.html
This PR resolves the issue where
pg_isready
would fail whensocketDir
is set andlisten_addresses
is empty.pg_isready
is now modified to usesocketDir
when it is available.