Re: operator exclusion constraints

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: operator exclusion constraints
Дата
Msg-id 4B0402F7.3090105@agliodbs.com
обсуждение исходный текст
Ответ на Re: operator exclusion constraints  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: operator exclusion constraints
Список pgsql-hackers
All,

FWIW, I'm doing a redesign of a client's production web application
right now.  I was able, by combining OEC and the Period type from
pgfoundry, to make a set of constraints for declaratively asserting in a
sports database:

That the same player couldn't belong to two different teams at the same
time;
That the same player couldn't belong to the same team in two different
positions with overlapping time periods.

This worked as spec'd, and would be extremely useful for this real-world
app if it was ready to use in production now.

However, I do have an issue with the SQLSTATE returned from the OEC
violation.  Currently it returns constraint violation, which, from the
perspective of an application developer, is not useful.  OECs are, in
application terms, materially identical to UNIQUE constraints and serve
the same purpose.  As such, I'd far rather see OECs return unique key
violation instead, as any existing application error-trapping code would
handle the violation more intelligently if it did.

--Josh Berkus



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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: operator exclusion constraints
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Very bad FTS performance with the Polish config