Search Postgresql Archives

Re: Multi-table CHECK constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Broersma wrote:
On Wed, Dec 10, 2008 at 3:58 PM, Jason Long
<mailing.list@xxxxxxxxxxxxxxxxxxxxx> 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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux