[PostGIS] #5899: pg_upgrade fails restore geography because spatial_ref_sys does not exist

PostGIS trac at osgeo.org
Fri May 16 13:52:45 PDT 2025


#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.2.9
 Component:  postgis  |    Version:  3.4.x
Resolution:           |   Keywords:
----------------------+---------------------------
Comment (by robe):

 I think the failure is happening here -

 https://git.osgeo.org/gitea/postgis/postgis/src/branch/master/postgis/gserialized_typmod.c#L344
 call to srid_check_latlong

 I'm thinking some of these possible solutions:

 1) Any spatial_ref_sys check should confirm the table exists and is not
 empty otherwise just return success with a warning.  This would also take
 care of those situations where people are using ST_Transform on their
 indexes or have check constraints checking spatial_ref_sys and pg_upgrade
 doesn't create spatial_ref_sys or populate spatial_ref_sys before trying
 to load user data.

 2) Change srid_check_latlong, to hard-code some common known long lats (or
 read from proj.db) and check against that before resorting to reading
 spatial ref sys.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5899#comment:1>
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