Re: Assertion constraint replacement?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Assertion constraint replacement?
Дата
Msg-id 20020516095157.K88788-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Assertion constraint replacement?  ("Tille, Andreas" <TilleA@rki.de>)
Список pgsql-general
On Thu, 16 May 2002, Tille, Andreas wrote:
>   An assertion is a special type of integrity constraint and shares
>   the same namespace as other constraints. However, an assertion is
>   not necessarily dependent on one particular table as constraints
>   are, so SQL92 provides the CREATE ASSERTION statement as an
>   alternate method for defining a constraint:
>
>   CREATE ASSERTION name CHECK ( condition )
>
>   PostgreSQL does not implement assertions at present.
>
> So Assertions might be the thing I'm looking for.  How can I implement a
> kind of logic
>
>       Accept value for column if it is contained in
>
>          select SomeId from OtherTable where SomeOtherColumn = Value ;

Triggers are probably your best bet.  Note too that changes to othertable
may also make the assertion fail, so probably an insert/update trigger
on the main table and update/delete trigger on OtherTable.



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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Is there eny e-mail server that uses postgreSQL
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: [HACKERS] Re : Solaris Performance - 64 bit puzzle