EXCLUDE, Gist and integers

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема EXCLUDE, Gist and integers
Дата
Msg-id CAD3a31VZ548B0fbsfwurZftb37iZCejTe=6hbqDvfeL9z-Uqag@mail.gmail.com
обсуждение исходный текст
Ответы Re: EXCLUDE, Gist and integers  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgsql-general
Hi.  I'm looking into adding daterange exclusions to some of my tables.  Following the documentation, I can do this no problem to prevent any records from overlapping:

CREATE TEMP TABLE foo (
  client_id integer,
  start_date date NOT NULL,
  end_date date,
  EXCLUDE using gist (daterange(start_date,end_date) with &&)
);

But what I really want is no overlapping records on a per-client basis.  I optimistically tried this:

CREATE TEMP TABLE foo (
  client_id integer,
  start_date date NOT NULL,
  end_date date,
  EXCLUDE using gist (daterange(start_date,end_date) with &&,client_id with =)
);

But Postgres responds thusly:

ERROR:  data type integer has no default operator class for access method "gist"
HINT:  You must specify an operator class for the index or define a default operator class for the data type.

Can someone tell me what's the easiest way to make this work?  Thanks in advance!

Ken

--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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

Предыдущее
От: Ronald Peterson
Дата:
Сообщение: Re: utf8 encoding problem with plperlu
Следующее
От: Tom Lane
Дата:
Сообщение: Re: utf8 encoding problem with plperlu