Re: Multi-table CHECK constraint

From: Jason Long <mailing(dot)list(at)supernovasoftware(dot)com>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Multi-table CHECK constraint
Date: 2008-12-11 00:23:35
Message-ID: 49405D87.2080104@supernovasoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Broersma wrote:
> On Wed, Dec 10, 2008 at 3:58 PM, Jason Long
> <mailing(dot)list(at)supernovasoftware(dot)com> wrote:
>
>
>> I need to add some complex constraints at the DB.
>> These will involve several tables.
>> What is the best approach for this?
>>
>
> Well ANSI-SQL provides the CREATE ASSERTION for this purpose.
> However, PostgreSQL doesn't support this feature. It can be mimiced
> by using the PostgreSQL CONSTRAINT TRIGGER extenstion. IIRC, it works
> very much like an ordinary trigger except that you must raise an error
> when an DML attempt possibly violates your condition.
>
>
>> Can someone point me to an example of doing something like this?
>>
>
> http://www.postgresql.org/docs/8.3/interactive/sql-createconstraint.html
> http://www.postgresql.org/docs/8.3/interactive/triggers.html
>
> I hope this helps.
>
>
>
Thanks. I will look into this and see how it goes.

Any other advice would be greatly appreciated.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2008-12-11 00:32:19 Re: Multi-table CHECK constraint
Previous Message Richard Broersma 2008-12-11 00:17:58 Re: Multi-table CHECK constraint