Fix handling of collations in multi-row VALUES constructs.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Apr 2011 19:31:52 +0000 (15:31 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Apr 2011 19:31:52 +0000 (15:31 -0400)
commit918854cc08868d569aad3bdf2529fc61c66ecde5
treee6175eed7446145d62b0bb707d83f29209837556
parent04db0fdbfa9382730bb65f94bca2cd8063a3456a
Fix handling of collations in multi-row VALUES constructs.

Per spec we ought to apply select_common_collation() across the expressions
in each column of the VALUES table.  The original coding was just taking
the first row and assuming it was representative.

This patch adds a field to struct RangeTblEntry to carry the resolved
collations, so initdb is forced for changes in stored rule representation.
13 files changed:
src/backend/catalog/dependency.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/setrefs.c
src/backend/parser/analyze.c
src/backend/parser/parse_relation.c
src/include/catalog/catversion.h
src/include/nodes/parsenodes.h
src/include/parser/parse_relation.h
src/test/regress/expected/collate.out
src/test/regress/sql/collate.sql