Bug 2416593

Summary: Postgres upgrade impossible for postgis databases
Product: [Fedora] Fedora Reporter: Georg Sauthoff <fedora>
Component: postgisAssignee: Sandro Mani <manisandro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 43CC: admiller, devrim, hhorak, manisandro, neil, pkubat, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-01-09 17:20:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Georg Sauthoff 2025-11-23 00:45:21 UTC
Basically it's the same issue as in: Bug 2254839

When upgrading a postgis enabled postgres database from f41 to f43,
the database upgrade is impossible with fedora packages,
because the postgis package is only available for postgres18.

This is a problem because latest postgres on f41 is postgres16,
such that the database upgrade on f43 requires first installing postgres17 and then postgresql17, while the postgis-upgrade package depends on postgres18.

And there is no postgis-upgrade17 package available.

Reproducible: Always

Steps to Reproduce:
1. install fedora 41 with postgres and postgis, create postgres database and enable the postgis extension on that database
2. dnf system-upgrade to fedora 43
3. upgrade existing postgres database via postgresql-setup --upgrade
Actual Results:
Error that the upgrade doesn't support the step from postgres 16 to 17.
Installing postgres17 removes the postgis package, though.

Expected Results:
Postgis is also available for the postgres database upgrade from version 16 to 17 and from 17 to 18.

Additional Information:
Note that upgrades over 2 Fedora releases are specified to be supported:

> Upgrades to the very next release (e.g. 42 to 43) as well as upgrades skipping one release (e.g. 41 to 43) are both supported.


https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/#sect-how-many-releases-can-i-upgrade-across-at-once


---

To work around this issue I had to upgrade my database using the postgres and postgis versions provided by postgresql.org, like this:


```
dnf install https://download.postgresql.org/pub/repos/yum/reporpms/F-43-x86_64/pgdg-fedora-repo-latest.noarch.rpm
dnf --setopt=install_weak_deps=False  install postgresql17-server postgis36_17
cd /var/lib/pgsql
tar cfvz /root/pg-16-data.tar.gz data
/usr/pgsql-17/bin/postgresql-17-setup initdb
dnf --setopt=install_weak_deps=False  install postgresql16-server postgis34_16
sudo -u postgres /usr/pgsql-17/bin/pg_upgrade --old-datadir /var/lib/pgsql/data --new-datadir /var/lib/pgsql/17/data --old-bindir /usr/pgsql-16/bin --new-bindir /usr/pgsql-17/bin
systemctl start postgresql-17
# pg_upgrade mentions update_extensions.sql but that file is nowhere to be found ... thus, directly:
sudo -u postgres /usr/pgsql-17/bin/psql -d somedb -c 'ALTER EXTENSION "postgis" UPDATE;'
sudo -u postgres /usr/pgsql-17/bin/reindexdb somedb
systemctl stop postgresql-17
# NB: postgresql 18 enables checksums, by default
sudo -u postgres /usr/pgsql-17/bin/pg_checksums /var/lib/pgsql/17/data --enable --progress
postgresql-setup --initdb
sudo -u postgres pg_upgrade --old-datadir /var/lib/pgsql/17/data --new-datadir /var/lib/pgsql/data --old-bindir /usr/pgsql-17/bin --new-bindir /usr/bin
systemctl start postgresql
sudo -u postgres reindexdb somedb
sudo -u postgres /usr/bin/vacuumdb --all --analyze-in-stages --missing-stats-only
sudo -u postgres /usr/bin/vacuumdb --all --analyze-only
dnf remove postgresql16-server postgis34_16 postgresql17-server postgis36_17
# still some dependencies remain?!? ... thus:
dnf repoquery --installed-from-repo='pgdg*' | xargs dnf remove -y
dnf remove pgdg-fedora-repo-'*'
```

Comment 1 Fedora Update System 2025-12-31 09:11:45 UTC
FEDORA-2025-6b65552230 (postgresql16-postgis-3.6.1-1.fc43, postgresql17-postgis-3.6.1-1.fc43, and 1 more) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-6b65552230

Comment 2 Fedora Update System 2026-01-01 01:18:52 UTC
FEDORA-2025-6b65552230 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-6b65552230 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-6b65552230

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2026-01-09 17:20:47 UTC
FEDORA-2025-6b65552230 (postgresql16-postgis-3.6.1-1.fc43, postgresql17-postgis-3.6.1-1.fc43, and 1 more) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.