[postgis-users] Is it possible to do constraint exclusion based on spatial extents?

Rémi Cura remi.cura at gmail.com
Sun Aug 2 12:36:01 PDT 2015


Hey,
I asked this question to the postgres mailing list here:
http://www.postgresql.org/message-id/CAJvUf_szgMLxC4=b6+AgY9HgyPaRes2JVb6bTKXiFF6CXa_epw@mail.gmail.com

I would be very interested if you find a solution (I did not).

Cheers,
Rémi-C

2015-08-02 21:04 GMT+02:00 Stephen Woodbridge <woodbri at swoodbridge.com>:

> Hi,
>
> I know I can setup table inheritance and constraint exclusion based on say
> the state field. But I would like to do this based on geom and the table
> extents. How would I do this?
>
> Say for example, I create a roads table, then load data into roads_area1,
> roads_area2, etc and these inherit from roads.
>
> For the state abbrv. I might have:
>
> ALTER TABLE roads_area1 ADD CONSTRAINT chk
>    CHECK (state IN ('MA', 'ME', 'NH'));
>
> So doing the same based on geom column might look like:
>
> ALTER TABLE roads_area1 ADD CONSTRAINT bbox_chk
> CHECK (geom && <????>);
>
> So does this work?
>
> Do I need to do anything special to get postgresql to using constraint
> exclusion? What?
>
> How would I set <????>?
>
> These tables are create once and query often, so the extents are not
> changing after they are loaded.
>
> Thanks,
>   -Steve W
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150802/f70947dd/attachment.html>


More information about the postgis-users mailing list