On Mon, Aug 27, 2012 at 1:34 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > Maybe, but in that case shouldn't referencing a system column chuck an
> Yeah, possibly. I think none of them are populated with anything useful
> during INSERT checks (though OID might be an exception?). Less sure
> about the state during UPDATE checks, though.
> My vote honestly would be to make it be an error. A check constraint
which fails only after it has been saved and then updated strikes me as
behavior outside the role of a check constraint and dangerously so. It
doesn't work as advertised, and people will find this out only after their
data is shown not to be consistent with the check constraint.
This being said, again, my sense is that no inherit check constraints will
make it quite unlikely that this will ever affect production servers. So
failing this it's sufficient I think in future versions (maybe 9.3 forward)
to add a paragraph to the docs. Something like:
Warning: The behavior of a check constraint operating against a system
column is undefined. Check constraints are not intended to be used this way
and behavior may change without notice.
Maybe worth bringing up on the docs list. I don't mind the fact that
behavior is undefined in some cases. However, it might be a good idea to
let people know that they are moving into "we won't commit not to breaking
your app even if you get this to work" territory.
In response to
pgsql-bugs by date
|Next:||From: Amit Kapila||Date: 2012-08-28 10:40:07|
|Subject: Re: Minor inheritance/check bug: Inconsistent behavior|
|Previous:||From: Bruce Momjian||Date: 2012-08-28 02:40:53|
|Subject: Re: BUG #6489: Alter table with composite type/table|