[postgis-devel] Turning spatial_ref_sys into a view to separate system vs. user entries

Sandro Santilli strk at kbt.io
Tue Feb 1 16:24:03 PST 2022


I've pushed a 'spatial-ref-sys-view' branch in official repository
(for pick up by bots) that turns "spatial_ref_sys" into a view
and creates "spatial_ref_sys_postgis" and "spatial_ref_sys_user"
tables.

The view would pick up entries from "spatial_ref_sys_user" or
(if not found) from "spatial_ref_sys_postgis" to allow users to
both override and extend the system entries.

Such setup allows to keep system entries always up-to-date on upgrade
( https://trac.osgeo.org/postgis/ticket/5024 )

The postgis_full_version() function will report the presence
(and number of) overridden, to avoid users to accidentally use
out-of-date proj strings or SRIDs which previously did not exist
but appeared after upgrade.

Insert/delete/update operations on spatial_ref_sys view will be
proxied to the spatial_ref_sys_user table, for backward compatibility.

Bots are happy with the change (bots also test upgrades from older
postgis versions, as old as 2.3).

How do you feel about me pushing all this code to the master branch
for more human testing?

--strk; 

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html


More information about the postgis-devel mailing list