Here is the procedure from Arch PostgreSQL wiki entry updating a major version (systemd free).
Please backup the database before updating anything!
It is recommended that the postgresql packages be placed on the IgnorePkg list in /etc/pacman.conf to prevent an inaccessible database caused by an major version update.
IgnorePkg=postgresql postgresql-libs
If you need to find out the installed version.
# cat /var/lib/postgres/data/PG_VERSION
Note: Commands that should be run as the postgres user are prefixed by [postgres]$.
Start the database if it is not running, check the running database for the initdb encoding and locale arguments used to create it.
[postgres]$ psql -l
Once you have the values, stop the postgresql daemon.
Install the postgresql, lib and the old-upgrade packages.
# pacman -Syu postgresql postgresql-libs postgresql-old-upgrade
The "postgresql-old-upgrade" will provide the previous version for the update procedure.
$ ls /opt/pgsql-14/
bin include lib share
Move data and create new locations.
# mv /var/lib/postgres/data /var/lib/postgres/olddata
# mkdir /var/lib/postgres/data /var/lib/postgres/tmp
# chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp
[postgres]$ cd /var/lib/postgres/tmp
Initialize using the same initdb arguments as were used originally.
[postgres]$ initdb -D /var/lib/postgres/data --locale=xy_XY.UTF-8 --encoding=UTF8 --data-checksums
Please use the input the values specific to your database.
Upgrade, replacing PG_VERSION below, with the old PostgreSQL version number which in this case is 14.
[postgres]$ pg_upgrade -b /opt/pgsql-<PG_VERSION>/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
Some addition considerations:
Start the postgresql daemon and the database should be accessible.
Tune and clean up stuff as desired once everything is running and verified sound.