From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Chao Li <li.evan.chao@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Subject: Re: Fix unqualified catalog references in psql describe queries
Date: Wed, 10 Jun 2026 06:16:36 +0000
Message-ID: <aikBRL/Tws2vmIjI@bdtpg> (raw)
In-Reply-To: <1236173.1781057568@sss.pgh.pa.us>
References: <C809E3C7-2437-486E-B626-0BE5F40BBB6C@gmail.com>
<aie76hpKavQ9nAqd@paquier.xyz>
<aifYIhmiqNr9mf6f@bdtpg>
<aijEfGcHUJvqjzNj@paquier.xyz>
<1236173.1781057568@sss.pgh.pa.us>
Hi,
On Tue, Jun 09, 2026 at 10:12:48PM -0400, Tom Lane wrote:
> Michael Paquier <michael@paquier.xyz> writes:
> > On Tue, Jun 09, 2026 at 09:08:50AM +0000, Bertrand Drouvot wrote:
> >> Now I wonder if we shoud not "protect" the operators too. They could also
> >> lead to wrong results (if not worst).
>
> > Kind of true. Still we have been pretty lax about the operators as
> > they also lead to less readable queries.
>
> We disclaimed security against odd search_paths for these queries long ago,
> precisely because wrapping every operator in PG_OPERATOR(pg_catalog.*)
> would be far too tedious and destructive of readability --- not to
> mention that there are some syntaxes such as IN that don't even offer
> the option to do that.
I do agree that doing so would "destroy" the readability. I did not look in detail,
but what about forcing ALWAYS_SECURE_SEARCH_PATH_SQL before the queries and
restore the search_path once the query is done? (that way that would not impact
the readability)
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, michael@paquier.xyz, li.evan.chao@gmail.com, pgsql-hackers@lists.postgresql.org, masao.fujii@gmail.com, peter@eisentraut.org, pgsql@j-davis.com, ashutosh.bapat.oss@gmail.com, amit.kapila16@gmail.com
Subject: Re: Fix unqualified catalog references in psql describe queries
In-Reply-To: <aikBRL/Tws2vmIjI@bdtpg>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox