Avoid using NAMEDATALEN in pg_upgrade
Bruce Momjian <bruce@momjian.us>
Avoid using NAMEDATALEN in pg_upgrade Because the client encoding might not match the server encoding, pg_upgrade can't allocate NAMEDATALEN bytes for storage of database, relation, and namespace identifiers. Instead pg_strdup() the memory and free it. Also add C comment in initdb.c about safe NAMEDATALEN usage.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_upgrade/info.c | modified | +20 −11 |
| contrib/pg_upgrade/pg_upgrade.h | modified | +6 −5 |
| src/bin/initdb/initdb.c | modified | +1 −1 |