Обсуждение: upgrade from 13 to 16
Is upgrade from ver. 13 to 16 possible?
-> $ sudo -u postgres pg_upgrade -D /var/lib/pgsql/data/
You must identify the directory where the old cluster binaries reside.
Please use the -b command-line option or the PGBINOLD environment variable.
Failure, exiting
Or is a restoration from a backup the only way?
many thanks, L.
Is upgrade from ver. 13 to 16 possible?
-> $ sudo -u postgres pg_upgrade -D /var/lib/pgsql/data/
You must identify the directory where the old cluster binaries reside.
Please use the -b command-line option or the PGBINOLD environment variable.
Failure, exiting
Or is a restoration from a backup the only way?
many thanks, L.
--
Data Egret GmbH
Your remote PostgreSQL DBA team
T.: +49 6821 919 3297
ik@dataegret.com
Since on LInux - unless tampered with manually - binaries get replaced upon upgrades of a package:
Is it worthwhile tampering with binaries as opposed to starting anew and with a backup? (which I eventually did, I get it might be a personal preference)
many thanks, L.
So, for now & the future "issues"...
Since on LInux - unless tampered with manually - binaries get replaced upon upgrades of a package:
pgsql-13
pgsql-14
pgsql-15
pgsql-16
pgsql-17
pgsql-9.6
But also rhel/centos do not do major PGsql rel. upgrade within the same/one OS release, I do not think so.
What happened to me - what I did rather - was upgrade from c9 to c10. (not officially supported.)
Cannot say about Debian but RHEL family (perhaps exceptions exist) do not, certainly not on Centos, Ubuntu which I use, yes.
But also rhel/centos do not do major PGsql rel. upgrade within the same/one OS release, I do not think so.
What happened to me - what I did rather - was upgrade from c9 to c10. (not officially supported.)
On Mon, 2026-03-02 at 13:43 +0100, listy wrote: > Is upgrade from ver. 13 to 16 possible? Yes. > -> $ sudo -u postgres pg_upgrade -D /var/lib/pgsql/data/ > You must identify the directory where the old cluster binaries reside.Please use the -b command-line option or the PGBINOLDenvironment variable. > Failure, exiting > > Or is a restoration from a backup the only way? > > If you cannot be bothered to read the documentation for pg_upgrade, then dump and restore may be the only way. Yours, Laurenz Albe
On Mon, Mar 2, 2026 at 9:09 AM listy <listy@localities.work> wrote:Cannot say about Debian but RHEL family (perhaps exceptions exist) do not, certainly not on Centos, Ubuntu which I use, yes.
But also rhel/centos do not do major PGsql rel. upgrade within the same/one OS release, I do not think so.
What happened to me - what I did rather - was upgrade from c9 to c10. (not officially supported.)This is why I strongly urge you to use the PGDG repositories, not the packages which RHEL builds.--Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.<Redacted> lobster!
Yes, RHEL doesn't take into account that PostgreSQL will ever be upgraded to another major version. They support the version which was current when they had their feature freeze for the lifetime of the system.
Therefore Ron is perfectly correct in writing that everybody should use the PGDG from the beginning.
You might have success installing the new version from PGDG repos and then run pg_upgrade (with all 4 mentioned options) from the new version. The preconditions for pg_upgrade are:
- you have the old and the new software version installed (pg-13 and pg-18) in different directories
- you have the old cluster unchanged and an empty new cluster in different directories
Maybe it helps to move the data directory of the old cluster before installing the new software package. Make sure you also change the path in the systemd service unit of the old version.
If the database isn't large, dump & restore will also work fine.
Regards,
Holger
Holger Jakobs, Bergisch Gladbach, Germany