Re: PSQL schema "describe" \dn is not escaping quotes - Mailing list pgsql-hackers

From Ajin Cherian
Subject Re: PSQL schema "describe" \dn is not escaping quotes
Date
Msg-id CAFPTHDapxLxVqfn9gejTbuf3ekog1Q2_aGFbwMeRSzvzgyg+Ow@mail.gmail.com
Whole thread
In response to PSQL schema "describe" \dn is not escaping quotes  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
On Wed, Sep 2, 2026 at 7:19 PM Peter Smith <smithpb2250@gmail.com> wrote:
>
> I've also added more test cases for verified multiple schema/footers
> with a common \dn pattern.
>
> ~~~
>
> PSA patch v4.

Hello Peter,

Thanks for the patch. I tested a few things and found a bug:

postgres=# CREATE SCHEMA "MySchema";
CREATE SCHEMA
postgres=# CREATE PUBLICATION pub_mixed FOR TABLES IN SCHEMA "MySchema";
CREATE PUBLICATION
postgres=# \dn "MySchema"
Schema "MySchema"
 Name | Owner
------+-------

The patch doesn't seem to work with certain quoted words. I don't
think you should be calling validateSQLNamePattern() and
processSQLNamePattern() from within describeOneSchemaDetails().
validateSQLNamePattern and processSQLNamePattern() assume that you are
passing in patterns rather than actual schema names and then go on to
standardise the name (like lowercasing it), but by the time the code
is inside describeOneSchemaDetails(), you already have the actual
schema name. These functions then convert the actual schema name
MySchema to myschema but then don't find it in the database, which is
why it isn't shown in the describe output.

regards,
Ajin Cherian
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Support for 8-byte TOAST values, round two
Next
From: Paul A Jungwirth
Date:
Subject: FOR PORTION OF bounds not coerced in PREPARE