-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
PostgreSQL extension packaging could be improved #38616
Comments
I'd also like to throw out there that In the past, PostgreSQL had a Thus, the set of PostgreSQL packages for version 10 and beyond should have the naming convention |
Another related issue to suss out, apparently having something really damn annoying to do with store permissions and the hacks we use to bundle the right libdirs: #38469 |
master...thoughtpolice:pgsql-fixes for more |
I personally don't see this as much of an issue. Picking a stable variant (more or less arbitrarily, I admit) and setting it as the default
There is this and the related #38469 I want to look into... The extension is in a state of some disarray and it's rather surprising it's gone on this long. (My indications seem to tell me almost nobody uses anything except postgis, honestly, or at least they always use it, which has masked related issues) |
(Oh, all that said @volth -- if you look at my branch, I actually did bump PostgreSQL to 10.x by default for 18.09 :) |
+1 for the proposal @thoughtpolice |
FWIW, #38698 now fixes all these issues, and many more. |
See NixOS#38616. This is a minor issue, and for now we keep around the old attribute name with a warning to tell people how to switch. Signed-off-by: Austin Seipp <aseipp@pobox.com>
See NixOS#38616. This is a minor issue, and for now we keep around the old attribute name with a warning to tell people how to switch. Signed-off-by: Austin Seipp <aseipp@pobox.com>
See NixOS#38616. This is a minor issue, and for now we keep around the old attribute name with a warning to tell people how to switch. Signed-off-by: Austin Seipp <aseipp@pobox.com> (cherry picked from commit 677c607)
See NixOS#38616. This is a minor issue, and for now we keep around the old attribute name with a warning to tell people how to switch. Signed-off-by: Austin Seipp <aseipp@pobox.com>
See NixOS#38616. This is a minor issue, and for now we keep around the old attribute name with a warning to tell people how to switch. Signed-off-by: Austin Seipp <aseipp@pobox.com>
State of things Now second problem is kinda solved, as we have So, the first problem can now be solved in 2 ways:
Not sure about mergeability of configs in last example... Docs are missing though. |
I'm closing this, as it's possible now to
|
Problem Description
Currently, when using PostgreSQL on NixOS, I see two major annoyances when using Postgresql extensions.
Problem 1: Extensions must be explicitly overridden to refer to the right PostgreSQL package
By default, Nixpkgs sets the top-level
postgresql
attribute to an arbitrary version. At the time of this writing, this version is 9.6, while the latest stable version available is actually 10.2.However, all packaged extensions (
postgis
,pg_hll
,timescaledb
, and more) are currently only built against thepostgres
attribute (equivalently: they are only built as 9.6 extensions.) This means that if I want to use PostgreSQL 10.2 on my NixOS machines, I must explicitly override thepostgres
argument to point to the right package. Otherwise, things aren't going to work when I runCREATE EXTENSION
in postgresql v10 and it tries to load a.so
file built for v9.6.As an example, here's a service description, snipped from my nixos configurations:
The problem here is that this is error prone (it's easy to forget), and even after that it's relatively non-obvious to a user how to properly configure the extensions unless they're already Nix-savvy. It's not unreasonable to want the most recent version of Postgres on a greenfield deployment, while the Nixpkgs default version may be different.
Ideally, extraPlugins really should do this attribute mapping itself, IMO. But at the same time...
Problem 2: The set of postgresql versions and extensions is not namespaced
If we are going to have multiple PostgreSQL versions, each with extensions, I strongly suggest we namespace them appropriately, yielding a top-level attribute set that can be used.
For example, we could have something like the following in
all-packages.nix
:Then, much like Linux kernel modules, a PostgreSQL extension for a particular version will be available under the corresponding attrset; e,g.
The motivation here is twofold, for me: one, these packages can't even be used without postgres, so having them in the top-level namespace seems wrong. Second, as a result of the first point, finding what extensions we support and updating them will be significantly easier IMO. Right now the only convenient thing tying all these packages together is that all related expressions are under
./pkgs/servers/sql/postgresql/
. This should be reflected in the namespace, IMO.Napkin sketch of new module API
If we had something like the above, we could simplify the above example of using Postgresql 10.x to something like:
Namely, the
services.postgresql.plugins
attribute contains a function which takes the attrset of all PostgreSQL extension packages as an argument, as specified by.packages
. Essentially you can think of it like a kind offilter
predicate that picks out the extensions you want, from the attrset containing every possible extension. By default this would be_: []
orconst []
.The text was updated successfully, but these errors were encountered: