Re: [NOVICE] Conditional constraint? - Mailing list pgsql-general

From Josh Berkus
Subject Re: [NOVICE] Conditional constraint?
Date
Msg-id web-821592@davinci.ethosmedia.com
Whole thread Raw
In response to Conditional constraint?  (Nick Haw <nick.haw@operagrp.com>)
List pgsql-general
Nick,

> What I want to do is make a field so that it requires a value after a
>  change
> in another field to a particular value. Is this possible with the ADD
> CONSTRAINT command, or will I have to make a custom function and use
>  a
> trigger.

That depends on how complicated your rules are.  All constraints must
 evaluate to a true/false statement, so complex procedures require a
 function + trigger instead.  How about posting some more details?

-Josh

pgsql-general by date:

Previous
From: "PGMailList"
Date:
Subject: Re: Field Constraints
Next
From: eel@javabox.com (Eel)
Date:
Subject: Converting/formatting timestamp arithmetic