Re: Multi-table CHECK constraint
От | Jason Long |
---|---|
Тема | Re: Multi-table CHECK constraint |
Дата | |
Msg-id | 49405D87.2080104@supernovasoftware.com обсуждение исходный текст |
Ответ на | Re: Multi-table CHECK constraint ("Richard Broersma" <richard.broersma@gmail.com>) |
Список | pgsql-general |
Richard Broersma wrote:
Any other advice would be greatly appreciated.
Thanks. I will look into this and see how it goes.On Wed, Dec 10, 2008 at 3:58 PM, Jason Long <mailing.list@supernovasoftware.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.
Any other advice would be greatly appreciated.
В списке pgsql-general по дате отправления: