Skip site navigation (1) Skip section navigation (2)

Re: [NOVICE] Conditional constraint?

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Nick Haw <nick(dot)haw(at)operagrp(dot)com>,"'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>,"'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>,"'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>,"'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [NOVICE] Conditional constraint?
Date: 2002-03-08 18:37:28
Message-ID: web-821592@davinci.ethosmedia.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
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

In response to

pgsql-novice by date

Next:From: BrianDate: 2002-03-08 19:04:30
Subject: Re: starting the postmaster
Previous:From: Robert J. Sanford, Jr.Date: 2002-03-08 18:05:19
Subject: Re: Good tutorial wanted...

pgsql-general by date

Next:From: Francisco ReyesDate: 2002-03-08 18:44:02
Subject: decimal(5) vs int8. Which more efficient.
Previous:From: Jeff AntoDate: 2002-03-08 18:15:14
Subject: a strange output from vacuum

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group