Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CAC389F9EED for ; Mon, 4 Dec 2006 23:30:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 11208-05-2 for ; Mon, 4 Dec 2006 23:30:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from proton.planetargon.com (unknown [198.145.37.35]) by postgresql.org (Postfix) with ESMTP id BC7FE9FA387 for ; Mon, 4 Dec 2006 23:30:48 -0400 (AST) Received: from [172.16.1.106] (unknown [61.197.227.146]) by proton.planetargon.com (Postfix) with ESMTP id 8BA16828173; Mon, 4 Dec 2006 19:30:46 -0800 (PST) In-Reply-To: <25943.1165287166@sss.pgh.pa.us> References: <8C5B026B51B6854CBE88121DBF097A8661E3FC@ehost010-33.exch010.intermedia.net> <25943.1165287166@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: "George Pavlov" , pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: null values in non-nullable column Date: Tue, 5 Dec 2006 12:30:44 +0900 To: Tom Lane X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/49 X-Sequence-Number: 27005 On Dec 5, 2006, at 11:52 , Tom Lane wrote: > "George Pavlov" writes: >> -- this creates a table with a not-nullable column (datatype >> -- inherited from the original table) which contains nulls; > > Hm. Arguably we should discard domain-ness in any SELECT result, > but I'm sure some people would complain about that ... Tom, Could you expand on that a bit? Here's what I've interpreted: The column types of the select are assumed to be (int, boolean_not_null), and so the values aren't checked again before the insert during CREATE TABLE AS. "discarding domain-ness" would mean considering the results as their base type, and rechecking the domain would be checked when inserting into the table. Just trying to fit my head around this. Michael Glaesemann grzm seespotcode net