Re: To-Do item: skip table scan for adding column with provable check constraints - Mailing list pgsql-hackers

From ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Subject Re: To-Do item: skip table scan for adding column with provable check constraints
Date
Msg-id d8jshx7nm16.fsf@dalvik.ping.uio.no
Whole thread Raw
In response to Re: To-Do item: skip table scan for adding column with provable check constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: To-Do item: skip table scan for adding column with provable check constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Robert Haas <robertmhaas@gmail.com> writes:
>> Right.  If there were a DEFAULT on the new column that would of course
>> be different, and you can also do thinks like CHECK (a != b) here.
>> However, if the CHECK constraint does not reference any column other
>> than the newly-added one, and if the new column will have the same
>> value for every row either because there is no default or because the
>> default is a constant,
>
> ... and if the CHECK expression is immutable ...

Doesn't it have to be already?  Otherwise a value accepted at one point
in time could suddenly violate the constraint later, even though it
never changed.


ilmari

-- 
"A disappointingly low fraction of the human race is,at any given time, on fire." - Stig Sandbeck Mathisen



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Speaking of breaking compatibility...standard_conforming_strings
Next
From: Andrew Gierth
Date:
Subject: Re: Allow COPY to use parameters