Re: Assertion constraint replacement?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Tille, Andreas" <TilleA(at)rki(dot)de>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Assertion constraint replacement?
Date: 2002-05-16 16:55:51
Message-ID: 20020516095157.K88788-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-05-16 19:54:32 Re: [HACKERS] Re : Solaris Performance - 64 bit puzzle
Previous Message Rich Shepard 2002-05-16 16:35:49 Re: Is there eny e-mail server that uses postgreSQL