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 1gMLIF-0006Sp-Mp for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 23:06:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMLIE-0001LX-3F for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 23:06:54 +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 1gMLID-0001LQ-O4 for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 23:06:53 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMLIA-0001Rn-Ow for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 23:06:52 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 124-v6so10146980wmw.0 for ; Mon, 12 Nov 2018 15:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=strobel.info; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YbHN3d52anK25agEFRJIUmiDYiAgOPYF9anZeW9cJNg=; b=ChHqRHnZH8CVNSC0B4xSorexmpu1vUiH5q8Z4MKtHU9wskhOISF+rhG5GFQValfxVF 7j+S8hPbJDoTn2vRnAzVlsWqkinrt5hteRB1Sxb1PHtuFSgAOttV9nqGUXcEYGxv8Ejs CFx6hmDi/7aBCWFhmB1u0FFZmDmo7d/qwokgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YbHN3d52anK25agEFRJIUmiDYiAgOPYF9anZeW9cJNg=; b=ZHpns/Y6YRmCNyEmzOOJM71MIXT+CL1hohQyvmd3mXHzYicL+HUUWl7kOurtICFI/r LYjEfVkx4BbOmjdVjj+9LSF5nHatUHa5mWZhDETVzQCtobOJ1twLq53KQmxY1Xe/GkAd yLhpqetxLsE+fXs0qIEanlDidcdCceB/KLeBzEvMm4mPh+JmpP7lzL/8Qt8mhYZAvBst 7G0di/9E4Tv8dctAl9OJTEcTVBtQsAWNm4YM60HklgRDR4HjpPrbJcqeGAfp99gkMYUe VMQl6KraO9WfP745ATxrEqTzbn1k7oMBXhNphBDzOqFiR6mrx4budXViT/NNSXnn+A76 czFg== X-Gm-Message-State: AGRZ1gLOfQiSYF2EpOJx/1SjS/BxSdqeMPimBQdAlcMUBZylbXwR5sne QvnR94A/PQuEoXVTtv18x/tfcAcBQm3cOQ== X-Google-Smtp-Source: AJdET5ePVu/7P221y5bsOff9kxg5iUL5BYZpn94fieG0dUJI312aJneTJ4y6m+sBRvuFMY183hr9kA== X-Received: by 2002:a1c:48d:: with SMTP id 135mr32343wme.1.1542064007901; Mon, 12 Nov 2018 15:06:47 -0800 (PST) Received: from Juergens-MacBook.local (178.115.129.242.wireless.dyn.drei.com. [178.115.129.242]) by smtp.gmail.com with ESMTPSA id o126-v6sm8075688wmo.3.2018.11.12.15.06.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Nov 2018 15:06:47 -0800 (PST) Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation To: Tom Lane , Alvaro Herrera Cc: Amit Langote , PostgreSQL Hackers References: <20181112140051.yv5m77esq5jz6rkg@alvherre.pgsql> <5662.1542040384@sss.pgh.pa.us> From: =?UTF-8?Q?J=c3=bcrgen_Strobel?= Message-ID: Date: Tue, 13 Nov 2018 00:06:45 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5662.1542040384@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-11-12 17:33, Tom Lane wrote: > 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. > I think I missed something, what are the *introduced* logical problems? Apart from implementation issues the only logical problems I see are if you allow to change defaults of the partition key columns, and these are problematic (nonsensical really) in either case. Regards, Jürgen