Re: PSQL schema "describe" \dn is not escaping quotes

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: surya poondla <suryapoondla4(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "jiaoshuntian(at)gmail(dot)com" <jiaoshuntian(at)gmail(dot)com>, "nishant(dot)sharma(at)enterprisedb(dot)com" <nishant(dot)sharma(at)enterprisedb(dot)com>, "jim(dot)jones(at)uni-muenster(dot)de" <jim(dot)jones(at)uni-muenster(dot)de>, "niushiji(at)gmail(dot)com" <niushiji(at)gmail(dot)com>
Subject: Re: PSQL schema "describe" \dn is not escaping quotes
Date: 2026-09-04 04:33:45
Message-ID: CAFPTHDapxLxVqfn9gejTbuf3ekog1Q2_aGFbwMeRSzvzgyg+Ow@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 2, 2026 at 7:19 PM Peter Smith <smithpb2250(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-09-04 04:35:23 FOR PORTION OF bounds not coerced in PREPARE
Previous Message Michael Paquier 2026-09-04 04:28:10 Re: Support for 8-byte TOAST values, round two