Re: check constraint on insert but not delete

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: check constraint on insert but not delete
Date: 2010-11-04 15:49:34
Message-ID: AANLkTimdQUf7ji3yBPmYgO4S_dDsVidwrX9FUi2xVSE9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 4, 2010 at 8:03 AM, Gauthier, Dave <dave(dot)gauthier(at)intel(dot)com> wrote:

> Is there a way to require that a check constraint be checked on insert but
> not update?    Worth knowing is that my check constraint runs a PLPgsql proc
> which returns a yes/no kinf of flag which the constraint proper checks.
I think by definition, Check constraints cannot differentiate between
an update or insert. Its only concern is if the data is valid or not.

If you need this flexibility, you should probably look at check constraints:
http://www.postgresql.org/docs/9.0/interactive/sql-createconstraint.html

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-11-04 15:54:22 Re: Linux
Previous Message Chris Browne 2010-11-04 15:44:38 Re: Linux