Fix parser so that we don't modify the user-written ORDER BY list in order
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Jul 2008 22:47:56 +0000 (22:47 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Jul 2008 22:47:56 +0000 (22:47 +0000)
commit34d11a88d77307d03f7c69c3ae1e3abd0b51269c
tree75ce5acfe2efdc092cab8ce57887f0a52765b5f9
parent191342cad17f8e86fb5e43e91da6668f095d2a51
Fix parser so that we don't modify the user-written ORDER BY list in order
to represent DISTINCT or DISTINCT ON.  This gets rid of a longstanding
annoyance that a view or rule using SELECT DISTINCT will be dumped out
with an overspecified ORDER BY list, and is one small step along the way
to decoupling DISTINCT and ORDER BY enough so that hash-based implementation
of DISTINCT will be possible.  In passing, improve transformDistinctClause
so that it doesn't reject duplicate DISTINCT ON items, as was reported by
Steve Midgley a couple weeks ago.
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepunion.c
src/backend/parser/analyze.c
src/backend/parser/parse_clause.c
src/include/nodes/parsenodes.h
src/include/parser/parse_clause.h