Release-upgrade from bionic -> focal breaks postgres if postgis is in use

Bug #1950772 reported by Andrew Gallagher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgis (Ubuntu)
New
Undecided
Unassigned

Bug Description

When performing a release upgrade from bionic to focal, the package postgresql-10-postgis-2.4 is removed due to dependency issues with libgdal20. But to perform a cluster upgrade from postgresql-10 to postgresql-12, both v10 and v12 clusters must be running, and so both versions of postgis must be installed.

Running pg_upgradecluster to upgrade from pgsql10->12 throws an error that postgis-2.4 is missing:

```
Starting new cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Roles, databases, schemas, ACLs...
pg_dump: error: query failed: ERROR: could not access file "$libdir/postgis-2.4": No such file or directory
pg_dump: error: query was: SELECT
a.attnum,
a.attname,
a.atttypmod,
a.attstattarget,
a.attstorage,
t.typstorage,
a.attnotnull,
a.atthasdef,
a.attisdropped,
a.attlen,
a.attalign,
a.attislocal,
pg_catalog.format_type(t.oid, a.atttypmod) AS atttypname,
'' AS attgenerated,
NULL AS attmissingval,
a.attidentity,
pg_catalog.array_to_string(ARRAY(SELECT pg_catalog.quote_ident(option_name) || ' ' || pg_catalog.quote_literal(option_value) FROM pg_catalog.pg_options_to_table(attfdwoptions) ORDER BY option_name), E',
    ') AS attfdwoptions,
CASE WHEN a.attcollation <> t.typcollation THEN a.attcollation ELSE 0 END AS attcollation,
array_to_string(a.attoptions, ', ') AS attoptions
FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t ON a.atttypid = t.oid
WHERE a.attrelid = '18012'::pg_catalog.oid AND a.attnum > 0::pg_catalog.int2
ORDER BY a.attnum
pg_dumpall: error: pg_dump failed on database "gis", exiting
Error during cluster dumping, removing new cluster
  sudo systemctl stop postgresql@12-main
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
  sudo systemctl daemon-reload
  sudo systemctl stop postgresql@10-main
Warning: the cluster will not be running as a systemd service. Consider using systemctl:
  sudo systemctl start postgresql@10-main
```

pg_dumpall fails similarly.

Reactivating the bionic repositories and installing postgresql-10-postgis-2.4 throws dependency issues:

```
# apt install postgresql-10-postgis-2.4 postgresql-10-postgis-2.4-scripts
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-10-postgis-2.4 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
```

So the v10 gis database is now apparently both unusable and upgradable.

Revision history for this message
Andrew Gallagher (andrewg-l) wrote :
summary: - Release-upgrade from bionic -> focal bricks postgres if postgis is in
+ Release-upgrade from bionic -> focal breaks postgres if postgis is in
use
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.