Adapt appendPsqlMetaConnect() to the new fmtId() encoding expectations.
authorTom Lane
Mon, 10 Feb 2025 21:30:03 +0000 (16:30 -0500)
committerTom Lane
Mon, 10 Feb 2025 21:30:03 +0000 (16:30 -0500)
commit5bf12323b6b8b05790aab6876555568898f4fc81
tree2cc3793f6fc62eb7dbea89a61b12cf9fe5d4700f
parent9f12da78d9538016efccbf17e6f816f1c286b7f5
Adapt appendPsqlMetaConnect() to the new fmtId() encoding expectations.

We need to tell fmtId() what encoding to assume, but this function
doesn't know that.  Fortunately we can fix that without changing the
function's API, because we can just use SQL_ASCII.  That's because
database names in connection requests are effectively binary not text:
no encoding-aware processing will happen on them.

This fixes XversionUpgrade failures seen in the buildfarm.  The
alternative of having pg_upgrade use setFmtEncoding() is unappetizing,
given that it's connecting to multiple databases that may have
different encodings.

Andres Freund, Noah Misch, Tom Lane

Security: CVE-2025-1094
src/fe_utils/string_utils.c