Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMFBL-0002Uk-VB for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 16:35:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMF9D-0002Uz-Cx for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 16:33:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMF9D-0002Um-2V for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 16:33:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMF9A-0000xN-NW for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 16:33:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wACGX4KW005663; Mon, 12 Nov 2018 11:33:04 -0500 From: Tom Lane To: Alvaro Herrera cc: =?utf-8?Q?J=C3=BCrgen?= Strobel , Amit Langote , PostgreSQL Hackers Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation In-reply-to: <20181112140051.yv5m77esq5jz6rkg@alvherre.pgsql> References: <20181112140051.yv5m77esq5jz6rkg@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Mon, 12 Nov 2018 11:00:51 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5661.1542040384.1@sss.pgh.pa.us> Date: Mon, 12 Nov 2018 11:33:04 -0500 Message-ID: <5662.1542040384@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > One of the guiding principles that I think we should hold for > partitioning is that operating directly into the partition should be > seen as only an optimization compared to inserting into the parent table > -- thus it should not behave differently. Applying different default > values depending on where you're inserting into goes counter to that > principle. I'm not entirely convinced that I buy that argument, especially not in a case like this where it introduces logical inconsistencies where there otherwise wouldn't be any. regards, tom lane