ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes:
> Tom Lane <t...@sss.pgh.pa.us> writes:
>> ... and if the CHECK expression is immutable ...

> Doesn't it have to be already?

AFAIK we don't insist on that currently.  You could imagine useful checks
that are not, for example CHECK(write_timestamp <= now()).

> Otherwise a value accepted at one point in time could suddenly violate
> the constraint later, even though it never changed.

True.  If you use a non-immutable check, it's on your head whether or not
this is a problem.  But the database shouldn't perform optimizations that
just assume it's immutable without checking.

                        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to