| От | Matthew Wilson |
|---|---|
| Тема | Need help writing exclusion constraint |
| Дата | |
| Msg-id | igsrss$3a5$1@dough.gmane.org обсуждение исходный текст |
| Ответы |
Re: Need help writing exclusion constraint
Re: Need help writing exclusion constraint Re: Need help writing exclusion constraint |
| Список | pgsql-general |
I have a table like this:
create table event(
destination_id integer not null references destination
(destination_id),
starts timestamp,
ends timestamp
);
I want to make sure that no two rows **with the same destination_id**
overlap in time.
I'm not sure how to write this exclusion constraint. I know how to make
the constraint to prevent any two rows from overlapping, but I want to
allow rows to overlap as long as they don't have the same
destination_id.
Thanks in advance.
Matt
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера