Re: Using SUBSELECT in CHECK expressions

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Using SUBSELECT in CHECK expressions
Date: 2003-11-05 17:14:12
Message-ID: 7A16FD0F-0FB3-11D8-B410-0005029FC1A7@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, November 5, 2003, at 06:26 AM, Tom Lane wrote:
> If you are satisfied with only a one-directional constraint (apply the
> check just when the constrained table is modified), you can have it
> today.
> Just put the SELECT into a function that's called by the CHECK
> expression.

Tom, you've just provided the solution to something I've been thinking
about a lot. I really have to start thinking in terms of functions. Are
there any restrictions on the function used in the CHECK, i.e., it must
be STRICT or IMMUTABLE? I took a quick look at the developer docs
(thinking they'd be for 7.4RC1. I was happily suprised to see they're
already labeled 7.5 dev!)

Michael
grzm myrealbox com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-11-05 17:22:34 Re: System crash and trying to run vacuum getting errors
Previous Message Alejandro Javier Pomeraniec 2003-11-05 17:12:12 Getting time from date field