Re: PSQL - prevent describe listing tables that are already in listed schemas

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PSQL - prevent describe listing tables that are already in listed schemas
Date: 2026-06-12 12:32:45
Message-ID: aiv8J3cBuVUQYEvv@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-May-21, Peter Smith wrote:

> I think Nisha was correct about adding a PG15 version check. It was an
> accidental omission in my first patch. Even if PG14 is EOL-ed by the
> time this change is released, it is trivial to keep the psql \dRp+
> command behaving as-is rather than crashing due to an internal SQL
> error. So, I prefer to err on the side of caution and add the version
> check for now; a committer can remove it if they deem it unnecessary.

They shouldn't; the Notes subsection in the psql reference page says

<para><application>psql</application> works best with servers of the same
or an older major version. Backslash commands are particularly likely
to fail if the server is of a newer version than <application>psql</application>
itself. However, backslash commands of the <literal>\d</literal> family should
work with servers of versions back to 9.2, though not necessarily with
servers newer than <application>psql</application> itself. The general
functionality of running SQL commands and displaying query results
should also work with servers of a newer major version, but this cannot
be guaranteed in all cases.
</para>

so the version check is definitely needed.

Thanks

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"In fact, the basic problem with Perl 5's subroutines is that they're not
crufty enough, so the cruft leaks out into user-defined code instead, by
the Conservation of Cruft Principle." (Larry Wall, Apocalypse 6)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-06-12 12:45:00 Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking
Previous Message Álvaro Herrera 2026-06-12 12:26:25 Re: Redundant/mis-use of _(x) gettext macro?