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

Sandro Santilli strk at kbt.io
Wed Feb 2 14:21:53 PST 2022


On Wed, Feb 02, 2022 at 05:24:20PM +0100, Sandro Santilli wrote:
> On Wed, Feb 02, 2022 at 02:57:21PM +0100, Even Rouault wrote:
> 
> > > Insert/delete/update operations on spatial_ref_sys view will be
> > > proxied to the spatial_ref_sys_user table, for backward compatibility.
> > 
> > What happens if a user tries to delete from spatial_ref_sys an entry that
> > comes from spatial_ref_sys_postgis ?
> > 
> > I'm asking since GDAL autotest suite
> > basically does "DELETE FROM spatial_ref_sys" + "INSERT INTO spatial_ref_sys
> > blabla" for one of its PostGIS tests (I guess we could avoid such radical
> > wiping out)
> 
> At the moment it does something like this:
> 
>     ERROR:  System SRID (4326) cannot be deleted

FYI: I've updated the code to work fine for your GDAL test case.
(DELETE would ignore the request, with a NOTICE, and INSERT will
create the overrides)

See
https://git.osgeo.org/gitea/postgis/postgis/commit/c42785decc18a477112083ca04816893ceb37641

--strk;

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


More information about the postgis-devel mailing list