Fix incorrect encoding-aware name truncation in makeArrayTypeName().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 16 Aug 2009 18:14:34 +0000 (18:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 16 Aug 2009 18:14:34 +0000 (18:14 +0000)
commit1128f9381d1a08dd624ae601917ae9eca2d6e4ca
tree8860bd7309c404a16636563a309faac9d7f949ae
parent1636f4c870d23693dcf26152a74522c25455fe68
Fix incorrect encoding-aware name truncation in makeArrayTypeName().

truncate_identifier won't do anything if the passed-in strlen is already
less than NAMEDATALEN, which it always would be given the strlcpy usage.
This has been broken since the arrays-of-composite-types code went in.

Arguably truncate_identifier is suffering from excessive optimization
and should always process the string, but for the moment I'll take the
more localized patch.

Per bug #4987.
src/backend/catalog/pg_type.c