Re: CHECK constraints inconsistencies

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Glaesemann <grzm(at)myrealbox(dot)com>, pgsql-bugs(at)postgresql(dot)org, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CHECK constraints inconsistencies
Date: 2004-03-02 02:25:01
Message-ID: 1078194300.39213.56.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, 2004-03-01 at 20:43, Bruno Wolff III wrote:
> On Mon, Mar 01, 2004 at 20:28:02 -0500,
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Michael Glaesemann <grzm(at)myrealbox(dot)com> writes:
> > > In both cases, the CHECK constraint uses a function that is stable or
> > > volatile. It was suggested that functions used in CHECK constraints be
> > > restricted to immutable,
> >
> > This seems reasonable to me. I'm a bit surprised we do not have such a
> > check already.
>
> There may be times you want to do this. For example you may want a timestamp
> to be in the past. In this case as long as it was in the past when the

Agreed that this is useful behaviour, but a trigger is usually a better
mechanism for confirming such data as you really only want to check it
when the value is changed.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-03-02 03:36:38 Re: [HACKERS] CHECK constraints inconsistencies
Previous Message Bruno Wolff III 2004-03-02 01:43:59 Re: [HACKERS] CHECK constraints inconsistencies

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-03-02 03:08:29 7.3.6 bundled ...
Previous Message Curt Sampson 2004-03-02 01:52:52 Re: Check Constraints and pg_dump