From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru> |
Subject: | (9.1) btree_gist support for searching on "not equals" |
Date: | 2010-05-21 20:47:36 |
Message-ID: | 1274474857.27379.101.camel@jdavis-laptop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
This patch adds support to btree_gist for searching on <> ("not
equals").
This allows an interesting use of exclusion constraints:
Say you have a table:
create table zoo
(
cage int,
animal text,
exclude using gist (cage with =, animal with <>)
);
That will permit you to add as many zebras as you want to a given cage,
and as many lions as you want to another cage, but will not allow you to
mix zebras and lions in the same cage.
It also allows you to enforce the constraint that only one tuple exists
in a table by doing something like:
create table a
(
i int,
exclude using gist (i with <>),
unique (i)
);
Regards,
Jeff Davis
Attachment | Content-Type | Size |
---|---|---|
btree-gist-ne.patch | text/x-patch | 7.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2010-05-21 21:05:10 | Re: Specification for Trusted PLs? |
Previous Message | Joshua Tolley | 2010-05-21 20:21:40 | Re: Specification for Trusted PLs? |