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 1pDVMi-0003Dl-9g for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2023 18:53:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pDVMh-0004Nl-5X for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2023 18:53:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDVMg-0004Nc-Sk for pgsql-hackers@lists.postgresql.org; Thu, 05 Jan 2023 18:53:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDVMe-0008Ay-NM for pgsql-hackers@lists.postgresql.org; Thu, 05 Jan 2023 18:53:21 +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 305IrJpT2793384 for ; Thu, 5 Jan 2023 13:53:19 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: ATTACH PARTITION seems to ignore column generation status MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2793382.1672944799.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 05 Jan 2023 13:53:19 -0500 Message-ID: <2793383.1672944799@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This does not seem good: regression=3D# create table pp (a int, b int) partition by range(a); CREATE TABLE regression=3D# create table cc (a int generated always as (b+1) stored, b = int); CREATE TABLE regression=3D# alter table pp attach partition cc for values from ('1') to= ('10'); = ALTER TABLE regression=3D# insert into pp values(1,100); INSERT 0 1 regression=3D# table pp; a | b = -----+----- 101 | 100 (1 row) I'm not sure to what extent it's sensible for partitions to have GENERATED columns that don't match their parent; but even if that's okay for payload columns I doubt we want to allow partitioning columns to be GENERATED. regards, tom lane