[postgis-devel] PSC Vote: Make spatial_ref_sys as a view

Regina Obe lr at pcorp.us
Fri Feb 4 14:16:33 PST 2022


I'm calling for a formal vote to put into master the hard work that Sandro
has already done in -
https://git.osgeo.org/gitea/postgis/postgis/src/branch/spatial-ref-sys-view 

+1 from me.

Reason:
We need a clean way to update/insert new spatial_ref_sys entries without
accidentally messing up ones that users explicitly put in or update.
Right now we have a bug that we are not updating spatial_ref_sys at all so
upgrades are incomplete without users manually filtering thru
spatal_ref_sys.sql and adding the ones they are missing.

We had hoped to use ranges, but users get those from various sources, so I
think the range idea is impractical for many users.

To summarize the plan:

1) spatial_ref_sys will become a view with INSERT/UPDATE/DELETE instead of
triggers
And will be a union of spatial_ref_sys_postgis and spatial_ref_sys_user
which I will describe in next bullets.
The entries in spatial_ref_sys_user override those in
spatial_ref_sys_postgis

2) spatial_ref_sys_postgis will have all the entries we currently have 
For upgrades

TRUNCATe spatial_ref_sys_postgis
INSERT spatial_ref_sys_postgis
:

3) User entries will be in spatial_ref_sys_user

4) For backward compatibility if a user inserts an entry in the
spatial_ref_sys view, the INSERT will be redirected to
spatial_ref_sys_user

5) The clean idea - we can change later, but plan would be any entries in
spatial_ref_sys_user that are exactly the same as the ones in
spatial_ref_sys_postgis would be removed.
Presumably most of these were added cause our spatial_ref_sys was out of
date and people needed newer ones.





More information about the postgis-devel mailing list