PostgreSQL: Difference between revisions
m Changed /var/lib/postgresql to /var/run/postgresql because this is the actual location of the Unix socket. |
Add upgrade instructions |
||
| Line 280: | Line 280: | ||
outline=# ALTER DATABASE outline REFRESH COLLATION VERSION; | outline=# ALTER DATABASE outline REFRESH COLLATION VERSION; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Major upgrades == | |||
If you're using NixOS' modules for PostgreSQL and find yourself in a boot/switch after a major bump of it, you'll need to upgrade your cluster. | |||
Let the service successfully start once, and then stop it. Upon completion, proceed with the following command, substituting the numbers 15 and 16 with the respective versions you previously used and the more recent one: | |||
<syntaxhighlight> | |||
sudo -u postgres pg_upgrade -b "$(nix build --no-link --print-out-paths nixpkgs#postgresql_15.out)/bin" -B /run/current-system/sw/bin -d /var/lib/postgresql/15 -D /var/lib/postgresql/16 | |||
</syntaxhighlight> | |||
== See also == | == See also == | ||