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 1pgsAm-0006ZA-68 for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2023 19:06:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pgsAl-00019b-36 for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2023 19:06:27 +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 1pgsAk-00019P-RJ for pgsql-bugs@lists.postgresql.org; Mon, 27 Mar 2023 19:06:26 +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 1pgsAi-000185-M4 for pgsql-bugs@lists.postgresql.org; Mon, 27 Mar 2023 19:06:25 +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 32RJ6L5x3332643; Mon, 27 Mar 2023 15:06:21 -0400 From: Tom Lane To: Alexander Lakhin cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently In-reply-to: <67cb509e-93c7-1c7b-2388-d7e00277b344@gmail.com> References: <17872-d0fbb799dc3fd85d@postgresql.org> <3169550.1679928579@sss.pgh.pa.us> <3182314.1679935605@sss.pgh.pa.us> <1aa2eec0-2017-3870-6d88-228d08c587d3@gmail.com> <3267914.1679941213@sss.pgh.pa.us> <67cb509e-93c7-1c7b-2388-d7e00277b344@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Mon, 27 Mar 2023 22:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3332641.1679943981.1@sss.pgh.pa.us> Date: Mon, 27 Mar 2023 15:06:21 -0400 Message-ID: <3332642.1679943981@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > 27.03.2023 21:20, Tom Lane wrote: >> Hmm ... really? I'd just concluded that a partitioned table is okay >> as long as it doesn't yet have any partitions. Even if the modified >> type is a partitioning column, there's no structure yet that could >> depend on the contents of the type. (If it does have partitions, >> we'll fail when we get to one of those.) > The following query leads to a failure on showing a partition definition: > CREATE TABLE tbl(a int, b int) PARTITION BY LIST ((tbl)); > CREATE TABLE tblp PARTITION OF tbl FOR VALUES IN ('(2,4)'); > ALTER TABLE tbl ALTER COLUMN a TYPE char(5); Sure, but there you already have a partition. If you only had "tbl" then there would be no stored partition bounds. regards, tom lane