can this be done with a check expression?

Поиск
Список
Период
Сортировка
От Wayne Cuddy
Тема can this be done with a check expression?
Дата
Msg-id 20120802231043.GA16173@slacker.ja10629.home
обсуждение исходный текст
Ответы Re: can this be done with a check expression?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: can this be done with a check expression?  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
Список pgsql-sql
I have a table with 3 columns:

name text
start_id integer
end_id integer

start_id and end_id are ranges which must not overlap but can have gaps
between them. Is it possible to formulate a table check constraint that
can verify that either id does not fall within an existing range at
insert time? IE prevent overlaps during insert?

Thanks,
Wayne


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

Предыдущее
От: Samuel Gendler
Дата:
Сообщение: query structure for selecting row by tags
Следующее
От: Tom Lane
Дата:
Сообщение: Re: can this be done with a check expression?