Re: CTAS not honoring NOT NULL, DEFAULT modifiers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CTAS not honoring NOT NULL, DEFAULT modifiers
Date: 2010-04-19 13:48:01
Message-ID: 12700.1271684881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-04-19 14:11:29 Re: walreceiver is uninterruptible on win32
Previous Message Nikhil Sontakke 2010-04-19 12:34:32 Re: CTAS not honoring NOT NULL, DEFAULT modifiers