Thread: pgsql: Avoid using NAMEDATALEN in pg_upgrade

pgsql: Avoid using NAMEDATALEN in pg_upgrade

From
Bruce Momjian
Date:
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dc9896a2457f0d72458f1ff45935362521f0f99c

Modified Files
--------------
contrib/pg_upgrade/info.c       |   31 ++++++++++++++++++++-----------
contrib/pg_upgrade/pg_upgrade.h |   11 ++++++-----
src/bin/initdb/initdb.c         |    2 +-
3 files changed, 27 insertions(+), 17 deletions(-)