Re: Error in exclusion constraint error message (8.5)?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Error in exclusion constraint error message (8.5)?
Дата
Msg-id 407d949e1001021037g7427eef0x5392f655698245a5@mail.gmail.com
обсуждение исходный текст
Ответ на Error in exclusion constraint error message (8.5)?  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: Error in exclusion constraint error message (8.5)?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sat, Jan 2, 2010 at 1:37 PM, hubert depesz lubaczewski
<depesz@depesz.com> wrote:
> =A0 =A0CONSTRAINT overlapping_times EXCLUDE USING GIST (
> =A0 =A0 =A0 =A0box(
> =A0 =A0 =A0 =A0 =A0 =A0point( extract(epoch FROM from_ts at time zone 'UT=
C'), extract(epoch FROM from_ts at time zone 'UTC') ),
> =A0 =A0 =A0 =A0 =A0 =A0point( extract(epoch FROM to_ts at time zone 'UTC'=
) =A0, extract(epoch FROM to_ts at time zone 'UTC') )
> =A0 =A0 =A0 =A0) WITH &&
>

Hm, this would be easier to write as:

CONSTRAINT overlapping_times EXCLUDE USING GIST (
  tinterval(from_ts::abstime, to_ts::abstime) WITH &&

But that still seems a bit more complex than ideal. Would it be
reasonable to have a tinterval() constructor which takes timestamptz
data types? Then you could just write

CONSTRAINT overlapping_times
  EXCLUDE USING GIST (tinterval(from_ts, to_ts)) USING &&


--=20
greg

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error in exclusion constraint error message (8.5)?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error in exclusion constraint error message (8.5)?