Skip site navigation (1) Skip section navigation (2)

Re: BUG #5053: domain constraints still leak

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5053: domain constraints still leak
Date: 2009-09-21 16:31:31
Message-ID: 200909211631.n8LGVVq27772@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Sam Mason wrote:
> On Mon, Sep 14, 2009 at 10:54:07AM -0500, Kevin Grittner wrote:
> > Sam Mason <sam(at)samason(dot)me(dot)uk> 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 quirk?
> 
> That's why I pointed it out!
> 
> Based on my reading of the SQL spec (and reading about Codd's
> descriptions of domains) I'd say it was a bug/implementation quirk.

Do we need a TODO for this item?  Also, I see this odd behavior even
without domains:

	test=> CREATE TYPE xx AS (x INT);
	CREATE TYPE
	test=> CREATE TABLE test4(col1 xx NOT NULL);
	CREATE TABLE
	test=> INSERT INTO test4 VALUES (ROW(NULL));
	INSERT 0 1
	test=> SELECT * FROM test4 WHERE col1 IS NULL;
	 col1
	------
	 ()
	(1 row)

Here I am illustrating that NOT NULL and IS NULL have different ideas of
what a NULL is?  That seems odd too.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2009-09-21 17:22:29
Subject: Re: BUG #5053: domain constraints still leak
Previous:From: Alvaro HerreraDate: 2009-09-21 16:24:59
Subject: Re: TODO item: Allow more complex user/database default GUC settings

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2009-09-21 16:49:22
Subject: Re: Drop schema cascade fails since postgresql 8.4
Previous:From: Alvaro HerreraDate: 2009-09-21 16:06:30
Subject: Re: BUG #5066: plperl issues with perl_destruct() and END blocks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group