Notes from UPDATING |
- These upgrade notes are taken from /usr/ports/UPDATING
- 2025-05-06
Affects: users of databases/postgresql* and other software using PostgreSQL to run Author: kbowling@FreeBSD.org Reason:
The default version of PostgreSQL has been switched from 16 to 17.
The upgrade procedure can use up twice the space the databases
currently needs. If you have a big amount of stored data take a
closer look at the manpage of pg_upgrade for avoidance and/or
speedup of the upgrade.
The upgrade instructions consider a basic usage and do not match
complex scenarios like replication, sharding, or similar.
Upgrade instructions:
First stop your PostgreSQL, create PostgreSQL-binaries and backup your data.
If you have another Version of PostgreSQL installed, for example 16, your
files are named according to this.
# service postgresql stop
# pkg create postgresql16-server postgresql16-contrib
# mkdir /tmp/pg-upgrade
# tar xf postgresql16-server-16.8.pkg -C /tmp/pg-upgrade
# tar xf postgresql16-contrib-16.8.pkg -C /tmp/pg-upgrade
# pkg delete -f databases/postgresql16-server databases/postgresql16-contrib databases/postgresql16-client
Now update PostgreSQL:
pkg user:
# pkg install databases/postgresql17-server databases/postgresql17-contrib
# pkg upgrade
Portmaster users:
# portmaster databases/postgresql17-server databases/postgresql17-contrib
# portmaster -a
Portupgrade users:
# portinstall databases/postgresql17-server databases/postgresql17-contrib
# portupgrade -a
After installing the new PostgreSQL version you need to convert
all your databases to new version:
# su -l postgres -c "/usr/local/bin/initdb --encoding=utf-8 --lc-collate=C -D /var/db/postgres/data17 -U postgres"
# su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /var/db/postgres/data16/ -B /usr/local/bin/ -D /var/db/postgres/data17/ -U postgres "
Now the migration is finished. You can start PostgreSQL again with:
# service postgresql start
ATTENTION:
1) If you use non-default initdb options, you have to adjust the initdb-command accordingly
|
Number of commits found: 1
Commit History - (may be incomplete: for full details, see links to repositories near top of page) |
This is a slave port. You may also want to view the commits to the master port: databases/pgtcl | Commit | Credits | Log message |
2.1.1_3 08 May 2025 20:00:15
    |
Palle Girgensohn (girgen)  |
databases/postgresql??-*: Update to latest version
PostgreSQL 17.5, 16.9, 15.13, 14.18, and 13.21 Released!
The PostgreSQL Global Development Group has released an update to all
supported versions of PostgreSQL, including 17.5, 16.9, 15.13, 14.18,
and 13.21. This release fixes 1 security vulnerability and over 60 bugs
reported over the last several months.
Security: 78b8e808-2c45-11f0-9a65-6cc21735f730
Release
notes: https://www.postgresql.org/about/news/postgresql-175-169-1513-1418-and-1321-released-3072/ |
Number of commits found: 1
|