]> granicus.if.org Git - postgresql/commit
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)
commit63247bec284a935b3145d5302c834967049e5dea
tree5ec4c97c2b144ee82e67d53f407818083f581b87
parentb1fb3b2a7f0eec20502e4e7309ff52fc0288434a
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