Re: \dP and \dX use ::regclass without "pg_catalog."

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: \dP and \dX use ::regclass without "pg_catalog."
Date: 2022-01-08 19:50:19
Message-ID: 202201081950.teiyz4ic43oi@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Jan-08, Michael Paquier wrote:

> The detection regex posted upthread is kind of cool.

Yes, but it's not bulletproof -- it only detects uses of some
unqualified object name that is also used with qualification. Here it
detected "text" unqualified, but only because we already had
pg_catalog.text elsewhere. As an exercise, if you revert this commit
and change one of those "text" to "int", it's not detected as a problem.

My point is that it's good to have it, but it would be much better to
have something bulletproof, which we could use in an automated check
somewhere (next to stuff like perlcritic, perhaps). I don't know what,
though.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Cuando no hay humildad las personas se degradan" (A. Christie)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-01-08 19:55:28 Re: CLUSTER on partitioned index
Previous Message Jake North 2022-01-08 19:26:51 Re: [feature request] ts_headline should have an option to highlight only full matches of <-> expressions