3 ms·
Using gist indices for exclusion constraints (added in pg 9.0) can be pretty useful also. The Postgres docs show a simple example that enforces the constraint
by nierman 14y ago
Using gist indices for exclusion constraints (added in pg 9.0) can be pretty useful also.
The Postgres docs show a simple example that enforces the constraint "no two rows in the table contain overlapping circles" (&& is the overlaps operator for geometric types):
CREATE TABLE circles (
c circle,
EXCLUDE USING gist (c WITH &&)
);
http://www.postgresql.org/docs/9.1/static/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION http://www.postgresql.org/docs/9.1/static/ddl-constraints.ht...