[PostGIS] #5899: pg_upgrade fails restore geography because spatial_ref_sys does not exist
PostGIS
trac at osgeo.org
Mon May 25 15:20:56 PDT 2026
#5899: pg_upgrade fails restore geography because spatial_ref_sys does not exist
----------------------+---------------------------
Reporter: robe | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.7.0
Component: postgis | Version: 3.4.x
Resolution: | Keywords:
----------------------+---------------------------
Comment (by pramsey):
I think I figured out a hack...
In the code that looks up the SRID number and figures out how to represent
it (as an "EPSG:XX" token, or a WKT string or a PROJ string) we first
check for the existence of spatial_ref_sys, and then check for a non-zero
size... if it cannot pass both these tests then we bypass it, and hand an
"EPSG:XX" token directly into the proj lookup functions. This should, for
cases where we have EPSG numbers that match, which is 99% of them, just
Work. For people with custom codes, it will fail (still). For people with
non-custom but non-epsg codes (French government?) it will fail (still).
It does not FIX the problem, that requires pg_upgrade, but I think it
dramatically lowers the affected footprint.
Who is still screwed... people with custom srids or odd auth_name values
who use an SRID in functions called in the schema or have non-4326
geography srids in their schema.
For anyone with a non-missing and non-zero-sized spatial_ref_sys table
(mostly everyone) things should still work exactly the same.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5899#comment:13>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list