Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSmvZ-0002ia-TC for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Feb 2023 22:40:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pSmvY-0006Qz-Le for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Feb 2023 22:40:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSmvY-0006Qq-CE for pgsql-hackers@lists.postgresql.org; Thu, 16 Feb 2023 22:40:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSmvV-0006BK-VF for pgsql-hackers@lists.postgresql.org; Thu, 16 Feb 2023 22:40:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 31GMeMYm2334336; Thu, 16 Feb 2023 17:40:23 -0500 From: Tom Lane To: Alvaro Herrera cc: Alexander Lakhin , Amit Langote , pgsql-hackers@lists.postgresql.org, Peter Eisentraut Subject: Re: ATTACH PARTITION seems to ignore column generation status In-reply-to: <20230216180542.fdy5fnwkcbnhen6m@alvherre.pgsql> References: <20230216180542.fdy5fnwkcbnhen6m@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 16 Feb 2023 19:05:42 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2334334.1676587222.1@sss.pgh.pa.us> Date: Thu, 16 Feb 2023 17:40:22 -0500 Message-ID: <2334335.1676587222@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2023-Feb-16, Alexander Lakhin wrote: >> I've encountered a query that triggers an assert added in that commit: >> CREATE TABLE t(a int, b int GENERATED ALWAYS AS (a) STORED) PARTITION BY >> RANGE (a); >> CREATE TABLE tp PARTITION OF t(b DEFAULT 1) FOR VALUES FROM (0) to (1); > It seems wrong that this command is accepted. It should have given an > error, because the partition is not allowed to override the generation > of the value that is specified in the parent table. Agreed. We missed a check somewhere, will fix. regards, tom lane