postgresql: Add ensureExtensions option to service setup#75688
postgresql: Add ensureExtensions option to service setup#75688kampka wants to merge 1 commit intoNixOS:masterfrom
Conversation
|
Currently there is some disagreement about how far down the There is also a PR which aims to implement this functionality in a more declarative way: #72365 It might be more efficient to close this PR and work together with other community members working on this topic. Your call. |
Well, I am definitely on the pro-ensure side of the discussion, specifically because services need to handle privilege escalation escalation to setup their databases / users / extensions / etc. Not having this will probably lead to more services having
I have left some comments on that PR. Generally, I am not against collaborating on this topic. |
Motivation for this change
There are still a couple of services that create postgres extensions and databases in preStart,
usually relying on privilege escalation to do it. This change will allow us to simplify extension creation and unify these modules.
Heads up for potential reviewers: The postgresql tests suite currently fails because it also tests the pgbackup service. This service uses command line options that was removed in recent postgres versions. I'll try to address that issue in a separate PR.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @thoughtpolice