]> granicus.if.org Git - postgresql/commit
Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2000 18:11:50 +0000 (18:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2000 18:11:50 +0000 (18:11 +0000)
commitdd979f66be20fc54aad06da743f788fbc505bbe1
tree4d6b578e0afc7dc0198296940cd77c79c5eff66c
parent3f0074e403ac3a145c5e43db3348f45fe084703d
Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now
SELECT DISTINCT ON (expr [, expr ...]) targetlist ...
and there is a check to make sure that the user didn't specify an ORDER BY
that's incompatible with the DISTINCT operation.
Reimplement nodeUnique and nodeGroup to use the proper datatype-specific
equality function for each column being compared --- they used to do
bitwise comparisons or convert the data to text strings and strcmp().
(To add insult to injury, they'd look up the conversion functions once
for each tuple...)  Parse/plan representation of DISTINCT is now a list
of SortClause nodes.
initdb forced by querytree change...
32 files changed:
doc/src/sgml/ref/select.sgml
src/backend/executor/execTuples.c
src/backend/executor/nodeGroup.c
src/backend/executor/nodeUnique.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/freefuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepkeyset.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/tlist.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/parse_clause.c
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteManip.c
src/include/catalog/catversion.h
src/include/executor/nodeGroup.h
src/include/nodes/execnodes.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h
src/include/optimizer/planmain.h
src/include/optimizer/tlist.h
src/include/parser/parse_clause.h
src/test/regress/expected/errors.out
src/test/regress/expected/select_distinct_on.out
src/test/regress/sql/errors.sql
src/test/regress/sql/select_distinct_on.sql