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 1pgrS9-0004Dm-9O for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2023 18:20:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pgrS8-0006A6-4w for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Mar 2023 18:20:20 +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 1pgrS7-00069x-Sj for pgsql-bugs@lists.postgresql.org; Mon, 27 Mar 2023 18:20:19 +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 1pgrS5-0000jn-NM for pgsql-bugs@lists.postgresql.org; Mon, 27 Mar 2023 18:20:18 +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 32RIKDlb3267915; Mon, 27 Mar 2023 14:20:13 -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: <1aa2eec0-2017-3870-6d88-228d08c587d3@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> Comments: In-reply-to Alexander Lakhin message dated "Mon, 27 Mar 2023 21:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3267913.1679941213.1@sss.pgh.pa.us> Date: Mon, 27 Mar 2023 14:20:13 -0400 Message-ID: <3267914.1679941213@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > Yes, I think something like that can resolve the issue. > But I would also note that the problem is not with indexes only, but also > with "... partition by list(comp_type_value)", for example. 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.) [ thinks some more... ] I guess there's the corner case where we replace, say, a hashable type with a non-hashable one and thereby break decisions about whether PARTITION BY HASH is allowable. That's kind of a stretch. But find_composite_type_dependencies currently rejects partitioned tables, so we're not taking away any functionality if we continue to forbid that. regards, tom lane