Re: BUG #18637: CREATE INDEX won't look up operator classes in search_path if PARTITION BY is specified

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: usamoi(at)outlook(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18637: CREATE INDEX won't look up operator classes in search_path if PARTITION BY is specified
Date: 2024-10-03 03:19:03
Message-ID: 231375.1727925543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Rowley <dgrowleyml(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-10-03 04:19:49 Fix the description of what Schema Usage controls
Previous Message David Rowley 2024-10-03 03:11:40 Re: BUG #18637: CREATE INDEX won't look up operator classes in search_path if PARTITION BY is specified