pgsql: Avoid using NAMEDATALEN in pg_upgrade

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid using NAMEDATALEN in pg_upgrade
Date: 2012-12-20 18:56:33
Message-ID: E1TllIH-0006Fr-Uy@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-12-20 20:04:40 pgsql: Fix recycling of WAL segments after changing recovery target tim
Previous Message Heikki Linnakangas 2012-12-20 12:50:12 Re: [COMMITTERS] pgsql: Allow a streaming replication standby to follow a timeline switc