If you are using the old data in postgresql 13, you get the error after the upgrade to postgresql 14.
systemd[1]: Failed to start PostgreSQL database server.
Solution: How to migrate old sql data to new sql data.
sudo pacman -Sy postgresql-old-upgrade
sudo systemctl stop postgresql.service
sudo mv /var/lib/postgres/data /var/lib/postgres/olddata
sudo mkdir /var/lib/postgres/data
sudo chown postgres:postgres /var/lib/postgres/data
sudo su postgres
initdb -D /var/lib/postgres/data
/opt/pgsql-13/bin/pg_ctl -D /var/lib/postgres/olddata/ start
pg_dumpall -h /tmp -f /tmp/old_backup.sql
/opt/pgsql-13/bin/pg_ctl -D /var/lib/postgres/olddata/ stop
exit
sudo systemctl start postgresql.service
sudo su postgres
psql -f /tmp/old_backup.sql postgres
https://wiki.archlinux.org/title/PostgreSQL#Upgrading_PostgreSQL