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

Sandro Santilli strk at kbt.io
Wed Feb 2 15:30:10 PST 2022


On Wed, Feb 02, 2022 at 11:36:15PM +0100, Even Rouault wrote:
> 
> > > > 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)
> >
> Well, if the DELETE doesn't delete, then the test is broken anyway, since it
> relies on DELETE FROM spatial_ref_sys resulting in an empty view/table.

Ouch, I didn't consider this case.
If silently ignoring doesn't really give us backward compatibility now
I wonder if it was better to error out :?

--strk;


More information about the postgis-devel mailing list