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

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>, Magnus Hagander <magnus@hagander.net>, pgsql-hackers@lists.postgresql.org, Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2022-01-08T19:50:19Z
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)



Commits

  1. Fix issues with describe queries of extended statistics in psql

  2. Properly schema-prefix reference to pg_catalog.pg_get_statisticsobjdef_columns

  3. psql \dX: reference regclass with "pg_catalog." prefix