reindexdb: Change quoting rule of --schema?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: reindexdb: Change quoting rule of --schema?
Date: 2026-11-14 02:25:18
Message-ID: avfGjsaVe2HwuNNP@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,
(Original author and Alvaro in CC, for comments)

reindexdb --schema has the idea of not quoting the schema given in
input of the command line. For example, if a schema uses upper-case
characters, the command could fail. Perhaps a fmtIdEnc() should be
applied, in the same fashion as --tablespace? This point has come
from Alvaro, during a recent review for a separate patch.

Here is the suggested change:
case REINDEX_SCHEMA:
- appendPQExpBufferStr(sql, name);
+ appendPQExpBufferStr(sql, fmtIdEnc(name, PQclientEncoding(conn)));

There may be a point in treating that as a bug, but that's also a
backward-incompatible change so perhaps that could just be left as-is.
The new quoting behavior feels upgraded to me, though, but perhaps I'm
just biased.

Comments and/or opinions are welcome.
Thanks,
--
Michael

Attachment Content-Type Size
0001-reindexdb-Fix-quoting-for-schema-name-in-REINDEX-SCH.patch text/plain 2.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-11-14 02:51:40 Re: Add wait events for server logging destination writes
Previous Message Zsolt Parragi 2026-11-14 02:17:39 Re: [BUG / PATCH] PG19: VACUUM misestimates reltuples (often 0) after on-access VM setting