Re: CTAS not honoring NOT NULL, DEFAULT modifiers - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: CTAS not honoring NOT NULL, DEFAULT modifiers
Date
Msg-id 201004201517.o3KFHFd19393@momjian.us
Whole thread Raw
In response to Re: CTAS not honoring NOT NULL, DEFAULT modifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CTAS not honoring NOT NULL, DEFAULT modifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Nikhil Sontakke <nikhil.sontakke@enterprisedb.com> writes:
> > I think the semantics should be pretty ok as is. But I saw another DB
> > honoring the NOT NULL modifiers and hence the wonder if there is
> > something about this in the standards.
> 
> Actually, SQL:2008 does say that if an output column of the SELECT is
> known not nullable, then the created table should have the NOT NULL
> property for that column.  We don't implement anything about "known not
> nullable", though, so I'd view this as a small part of an unimplemented
> SQL feature.  The usefulness seems rather debatable anyway.

It is supposed to inspect the underlying column or look at the data
values returned and set NOT NULL based on that?  The later seems weird.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: RPM script bug #5430
Next
From: Tom Lane
Date:
Subject: Re: CTAS not honoring NOT NULL, DEFAULT modifiers