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

2009-09-21 Thread Robert Haas
On Mon, Sep 21, 2009 at 12:31 PM, Bruce Momjian wrote: > Sam Mason wrote: >> On Mon, Sep 14, 2009 at 10:54:07AM -0500, Kevin Grittner wrote: >> > Sam Mason wrote: >> > > the deeper problem seems to be that the table was created as: >> > > >> > >   create table test (a tstdom); >> > > >> > > and n

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

2009-09-21 Thread Bruce Momjian
Sam Mason wrote: > On Mon, Sep 14, 2009 at 10:54:07AM -0500, Kevin Grittner wrote: > > Sam Mason wrote: > > > the deeper problem seems to be that the table was created as: > > > > > > create table test (a tstdom); > > > > > > and not as: > > > > > > create table test (a tstdom not null); >

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

2009-09-14 Thread Sam Mason
On Mon, Sep 14, 2009 at 10:22:34AM -0400, Tom Lane wrote: > Robert Haas writes: > > It seems like regardless of this discussion you oughtn't to be able to > > store a NULL into that table column. But maybe I'm just confused. > > The system is relying on the not-unreasonable assumption that if it

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

2009-09-14 Thread Sam Mason
On Mon, Sep 14, 2009 at 10:54:07AM -0500, Kevin Grittner wrote: > Sam Mason wrote: > > the deeper problem seems to be that the table was created as: > > > > create table test (a tstdom); > > > > and not as: > > > > create table test (a tstdom not null); > > Given that tstdom is declared a

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

2009-09-14 Thread Kevin Grittner
Sam Mason wrote: > the deeper problem seems to be that the table was created as: > > create table test (a tstdom); > > and not as: > > create table test (a tstdom not null); Given that tstdom is declared as NOT NULL, is this difference considered a *feature* or is it an implementation q

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

2009-09-14 Thread Sam Mason
On Mon, Sep 14, 2009 at 11:16:23AM -0400, Robert Haas wrote: > I haven't read the code in this area, but for what it's worth, I guess > I lean toward the view that treating a row of NULLs as being the same > thing as an undecorated NULL does not make very much sense. I agree; when compared to most

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

2009-09-14 Thread Robert Haas
On Mon, Sep 14, 2009 at 10:22 AM, Tom Lane wrote: > Robert Haas writes: >> It seems like regardless of this discussion you oughtn't to be able to >> store a NULL into that table column.  But maybe I'm just confused. > > The system is relying on the not-unreasonable assumption that if it > extract

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

2009-09-14 Thread Tom Lane
Robert Haas writes: > It seems like regardless of this discussion you oughtn't to be able to > store a NULL into that table column. But maybe I'm just confused. The system is relying on the not-unreasonable assumption that if it extracts a column of type X from someplace, what it has is a valid

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

2009-09-14 Thread Robert Haas
On Sun, Sep 13, 2009 at 10:28 PM, Tom Lane wrote: > "Andrew Gierth" writes: >> Domain NOT NULL constraints (and probably other constraints too) aren't >> being enforced in some code paths. e.g. > > The example you give seems to tie really closely into the debate about > whether a composite null i

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

2009-09-13 Thread Tom Lane
"Andrew Gierth" writes: > Domain NOT NULL constraints (and probably other constraints too) aren't > being enforced in some code paths. e.g. The example you give seems to tie really closely into the debate about whether a composite null is identically the same thing as ROW(NULL,NULL) or not. In s

[BUGS] BUG #5053: domain constraints still leak

2009-09-13 Thread Andrew Gierth
The following bug has been logged online: Bug reference: 5053 Logged by: Andrew Gierth Email address: and...@tao11.riddles.org.uk PostgreSQL version: 8.5devel Operating system: FreeBSD Description:domain constraints still leak Details: Domain NOT NULL constraints (a