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 1gM3fk-00086I-Ee for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 04:18:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gM3fh-00063j-Uw for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 04:17:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gM3fh-00063c-Nl for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 04:17:57 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gM3fZ-0001Mz-QW for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 04:17:57 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wAC4HhAG008643; Mon, 12 Nov 2018 13:17:43 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 54AD9EA7A76; Mon, 12 Nov 2018 13:17:43 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 49D35EA7435; Mon, 12 Nov 2018 13:17:43 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 427ED40082F; Mon, 12 Nov 2018 13:17:43 +0900 (JST) Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation References: <20181109170712.pfn55lab5j7oae4v@alvherre.pgsql> <29152.1541802819@sss.pgh.pa.us> <6676.1541995199@sss.pgh.pa.us> From: Amit Langote Message-ID: Date: Mon, 12 Nov 2018 13:17:35 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <6676.1541995199@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Tom Lane Cc: Alvaro Herrera , =?UTF-8?Q?J=c3=bcrgen_Strobel?= , Amit Langote , Ashutosh Bapat , PostgreSQL Hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018/11/12 12:59, Tom Lane wrote: > Amit Langote writes: >> On 2018/11/10 7:33, Tom Lane wrote: >>> I'd argue not, actually. I think there is plausible precedent in >>> updatable views, where what we use is the defaults associated with the >>> view, not the underlying table. Correspondingly, what ought to govern >>> in a partitioned insert is the defaults associated with the table actually >>> named in the insert command, never mind what its partitions might say. >>> That is useful for many situations, and it avoids all the logical >>> inconsistencies you get into if you find that the defaults associated >>> with some partition would force re-routing elsewhere. > >> ... >> IOW, it might be a good idea to call the ability to set partition-level >> defaults a deprecated feature? > > Not necessarily. They'd apply when you insert directly into a particular > partition by name. Yes. Maybe, we should document that the partition default are not honored when inserting through the parent. Thanks, Amit