(9.1) btree_gist support for searching on "not equals"

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема (9.1) btree_gist support for searching on "not equals"
Дата
Msg-id 1274474857.27379.101.camel@jdavis-laptop
обсуждение исходный текст
Ответы Re: (9.1) btree_gist support for searching on "not equals"  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Список 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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: unnailing shared relations (was Re: global temporary tables)
Следующее
От: Josh Berkus
Дата:
Сообщение: Idea for getting rid of VACUUM FREEZE on cold pages