Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Sam Mason
On Mon, Sep 14, 2009 at 11:20:59PM -0400, Tom Lane wrote: There is some moderately interesting reading material in section 4.17.4 Domain constraints of SQL:2008. Not sure where to look for a copy of that, nor any particularly helpful links :( In particular, it appears to me that the standard

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Sam Mason
On Tue, Sep 15, 2009 at 05:13:21AM +0100, Andrew Gierth wrote: But there's a kicker: in Subclause 6.12, cast specification, in the General Rules is: a) If the cast operand specifies NULL, then the result of CS is the null value and no further General Rules of this Subclause

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Andrew Gierth
Sam == Sam Mason s...@samason.me.uk writes: But there's a kicker: in Subclause 6.12, cast specification, in the General Rules is: a) If the cast operand specifies NULL, then the result of CS is the null value and no further General Rules of this Subclause are applied. That no

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Tom Lane
Andrew Gierth and...@tao11.riddles.org.uk writes: Sam == Sam Mason s...@samason.me.uk writes: Sam The NOT NULL constraint feels wrong as well, what are the Sam semantics of: Sam CREATE DOMAIN d AS INTEGER NOT NULL; Sam SELECT a.n AS aa, b.n AS bb Sam FROM (VALUES (CAST(1 AS

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Sam Mason
On Tue, Sep 15, 2009 at 02:54:18PM +0100, Andrew Gierth wrote: the spec _does_ appear to allow CHECK(VALUE IS NOT NULL) as a domain constraint (in general the spec defines NOT NULL constraints this way), Huh, that's a trivial rewrite isn't it. Not sure why it didn't occur to me that it's just

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-15 Thread Kevin Grittner
Since our shop seems to use domains more than most, I figured I should comment on this thread. Sam Mason s...@samason.me.uk wrote: On Tue, Sep 15, 2009 at 02:54:18PM +0100, Andrew Gierth wrote: and the wording from 6.12 implies that that check is still skipped in the case of NULLs (so that

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-14 Thread Tom Lane
[ probably time to move this thread to -hackers ] There is some moderately interesting reading material in section 4.17.4 Domain constraints of SQL:2008. In particular, it appears to me that the standard goes out of its way to NOT claim that every value that is of a domain type satisfies the

Re: [HACKERS] [BUGS] BUG #5053: domain constraints still leak

2009-09-14 Thread Andrew Gierth
Tom == Tom Lane t...@sss.pgh.pa.us writes: Tom [ probably time to move this thread to -hackers ] Tom There is some moderately interesting reading material in section Tom 4.17.4 Domain constraints of SQL:2008. In particular, it Tom appears to me that the standard goes out of its way to NOT