Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swCMw-002NEo-9Z for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Oct 2024 03:19:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1swCMu-007q94-Ma for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Oct 2024 03:19:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swCMu-007q8v-D9 for pgsql-bugs@lists.postgresql.org; Thu, 03 Oct 2024 03:19:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swCMq-002HYx-EU for pgsql-bugs@lists.postgresql.org; Thu, 03 Oct 2024 03:19:07 +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 4933J3wm231376; Wed, 2 Oct 2024 23:19:03 -0400 From: Tom Lane To: David Rowley cc: usamoi@outlook.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18637: CREATE INDEX won't look up operator classes in search_path if PARTITION BY is specified In-reply-to: References: <18637-f51e314546e3ba2a@postgresql.org> Comments: In-reply-to David Rowley message dated "Thu, 03 Oct 2024 16:11:40 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <231374.1727925543.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 02 Oct 2024 23:19:03 -0400 Message-ID: <231375.1727925543@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > There's an item in the release notes [1] which should be expended to > mention this as an incompatibility, namely: > "Change functions to use a safe search_path during maintenance > operations (Jeff Davis) ยง I have not dug into the code, but I think this may actually be a bug; not because of the change of search path, but because it looks like the opclass is probably being looked up more than once during the command, with different search paths. That has security implications, and not good ones. We should fix this so that the opclass is looked up exactly once, and passed down to the partitions by OID not name. regards, tom lane