On Sat, Nov 14, 2026 at 11:25:18AM +0900, Michael Paquier wrote: > 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.
I think the change is mildly positive on balance. The rule would then be that possibly-schema-qualified options like --table need interior quoting, but single-name options don't. So a shell invocation would use --table='"Embedded""QuoteNSP"."T"' but would use --schema='Embedded"QuoteNSP'. I wouldn't back-patch it, though. > --- a/doc/src/sgml/ref/reindexdb.sgml > +++ b/doc/src/sgml/ref/reindexdb.sgml > @@ -210,6 +210,7 @@ PostgreSQL documentation > <listitem> > <para> > Reindex <replaceable class="parameter">schema</replaceable> only. > + (This name is processed as a double-quoted identifier.) While this wording is copied from --tablespace, I think it unhelpfully implies that "" inside the name will reduce to ", which is not the case. It would be more precise to say that the argument is treated as a literal schema name, not as an SQL identifier that needs parsing. (Passing the value through the shell may still require quoting at that level.) Something like that. Alternatively, perhaps say nothing. If someone passes a quoted name here, they'll tend to get a clean error. The --table and --index options have more acute need for docs, since their parsing is more complex.
