-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/postgresql: add option for domain sockets #207736
base: master
Are you sure you want to change the base?
Conversation
Adds a `socketDir` option corresponding to PostgreSQL's `unix_socket_directories` setting, and uses it in the setup scripts run post-start.
If both a nonstandard port and a nonstandard socket directory are used, then both must be passed to `psql`, since the socket filename includes the port number.
Bump: this module is still broken when custom socket directories are desired. This becomes a problem when running two PostgreSQL instances on the same host. In NixOS, this is accomplished by running a container with its own PostgreSQL service enabled. In order to make this instance externally accessible, one bind-mounts a host directory, which must then be configured as the socket directory. |
I think this change makes sense. Could you rebase? |
Adds a
socketDir
option corresponding to PostgreSQL'sunix_socket_directories
setting, and uses it in the setup scripts run post-start.Previously, in these scripts,
psql
tried to connect to the PostgreSQL via its TCP port. In a typicalpg_hba.conf
, all TCP connections, even those of localhost, are password protected. Since these scripts run unattended with no passwords provided, they actually worked by falling back to the domain socket. But when a non-standard socket directory is used, it must be explicitly passed topsql
. Thus, these scripts were previously broken for those using non-standard socket directories.PostgreSQL actually supports multiple socket directories, as well as @-prefixed paths for sockets in the "abstract namespace". However, supporting these would upset the types and serialization within the module.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes