[postgis-devel] [postgis-tickets] r17381 - TRUNCATE spatial_ref_sys upfront when running out_geography test

Sandro Santilli strk at kbt.io
Sun Apr 14 23:35:49 PDT 2019


On Sat, Apr 13, 2019 at 09:28:44AM +0300, Darafei "Komяpa" Praliaskouski wrote:
> This is very very bad. I had my dev thing down when tried to debug
> tickets.sql by playing it against different installs - when I'm superuser I
> succeed in removing spatial_ref_sys.
> 
> Can we instead check that we don't ever try to insert overlapping srids
> there?

I only did this because we were already doing it, check out:

    git grep TRUNCATE regress/

That said, the idea is that each and every regression test is
self-contained, which means you can run it in isolation.

Before this commit of mine you could not run the out_geography.sql
because it assumed an earlier script doing the TRUNCATE was running.

The reason why we're adding entries in spatial_ref_sys is because
we want to be in control of the exact entries we're putting there,
I think. But also when NOT using --extension with run_test.pl, we
are _not_ loading the data in spatial_ref_sys at all.

One thing we can do to avoid destroying real databases would be
to wrap tests in a BEGIN/ROLLBACK block. This should be easy and
would only ever leave behind any sequence increment.

--strk;

> 
> On Wed, Apr 10, 2019 at 7:15 PM Sandro Santilli <strk at kbt.io> wrote:
> 
> > Author: strk
> > Date: 2019-04-10 09:15:55 -0700 (Wed, 10 Apr 2019)
> > New Revision: 17381
> >
> > Modified:
> >    trunk/regress/core/out_geography.sql
> > Log:
> > TRUNCATE spatial_ref_sys upfront when running out_geography test
> >
> > .. this should probably be done upfront for all tests...
> >
> > Modified: trunk/regress/core/out_geography.sql
> > ===================================================================
> > --- trunk/regress/core/out_geography.sql        2019-04-10 16:15:46 UTC
> > (rev 17380)
> > +++ trunk/regress/core/out_geography.sql        2019-04-10 16:15:55 UTC
> > (rev 17381)
> > @@ -2,6 +2,9 @@
> >  --
> >  -- spatial_ref_sys data
> >  --
> > +
> > +TRUNCATE spatial_ref_sys;
> > +
> >  INSERT INTO "spatial_ref_sys"
> > ("srid","auth_name","auth_srid","proj4text") VALUES
> > (4326,'EPSG',4326,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
> >
> >  INSERT INTO "spatial_ref_sys" ("srid", "proj4text") VALUES (102189,
> > '+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1.000000
> > +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0
> > +units=m +no_defs ');
> >
> > _______________________________________________
> > postgis-tickets mailing list
> > postgis-tickets at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-tickets
> 
> 
> 
> -- 
> Darafei Praliaskouski
> Support me: http://patreon.com/komzpa

> _______________________________________________
> postgis-tickets mailing list
> postgis-tickets at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-tickets



More information about the postgis-devel mailing list