Thread: pgsql: Clean up handling of COLLATE clauses in index column definitions

Clean up handling of COLLATE clauses in index column definitions.

Ensure that COLLATE at the top level of an index expression is treated the
same as a grammatically separate COLLATE.  Fix bogus reverse-parsing logic
in pg_get_indexdef.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3bba9ce945a702ab116fcedb9c0b970ecd69c9dd

Modified Files
--------------
src/backend/commands/indexcmds.c                 |   85 +++++++++++++---------
src/backend/utils/adt/ruleutils.c                |   19 +++--
src/test/regress/expected/collate.linux.utf8.out |   18 +++--
src/test/regress/expected/collate.out            |   24 ++++---
src/test/regress/sql/collate.linux.utf8.sql      |    7 +-
src/test/regress/sql/collate.sql                 |   11 ++--
6 files changed, 94 insertions(+), 70 deletions(-)