-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Cleanup PostgreSQL for state version 17.09 #25753
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
Conversation
@bachp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @MarcWeber and @peti to be potential reviewers. |
could be added to release notes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good!
I think that all that's missing is a release note that explains the change and how to upgrade from 9.5 to 9.6 including changing the createuser -s postgres
Can somebody point me to where the releasenote cam be updated? |
The 17.09 release notes are part of the nixos manual and you can build it with |
I tried to add this the information to the release notes but I'm strugling to get the docbook syntax right. I first need to find some time to dig into this. So if somebody else is willing to write the entry please feel free to step up 😉 |
+1 on this change. What about having the following change as well? {
dataDir = mkOption {
default =
if versionAtLeast config.system.stateVersion "17.09"
then "/var/db/postgresql/${config.services.postgresql.package.psqlSchema}"
else "/var/db/postgresql";
};
} Including the schema version (like "9.6") in the Ubuntu, Debian and Gentoo do this as well. |
@balajisivaraman I tought about this aswell. I f no objections are there I will add the schema version to the path. |
I added the change proposed by @balajisivaraman |
@bachp I think you are mentioning me by mistake in this thread. Just letting you know so you can tag the correct person. 👍 |
@balajisivaraman Sorry I did this on my mobile 😉 I actually wanted to mention @basvandijk. |
Looks good to me. |
Added some release notes to the branch. @bachp if you can rebase the branch I will merge it. |
I'm thinking if changing the data dir to |
@bachp I would also slightly prefer that the default is moved to
|
I just noticed that the release note I added already mentions |
Change the default superuser from `root` to `postgres` for state version 17.09
The new directory includes the schema version of the database. This makes upgrades easier and is more consistent with other distros.
@zimbatm @basvandijk I rebase the PR and change the path to |
The <literal>postgres</literal> superuser name has changed from <literal>root</literal> to <literal>postgres</literal> to more closely follow what other Linux distributions are doing. | ||
</para> | ||
<para> | ||
The <literal>postgres</literal> default <literal>dataDir</literal> has changed from <literal>/var/lib/postgres</literal> to <literal>/var/db/postgresql/$psqlSchema</literal> where $psqlSchema is 9.6 for example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rename described here is the wrong way around (my fault). It should be from /var/db/postgres to /var/lib/postgres/$psqlSchema
!! |
Motivation for this change
postgres
userBoth these changes only apply if
system.stateVersion
is 17.09 or higher.See: #18144
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)