OSDN Git Service

Repair longstanding violation of SQL92 semantics: GROUP BY would
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Feb 2000 23:45:07 +0000 (23:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Feb 2000 23:45:07 +0000 (23:45 +0000)
commit751a14e60c309068557e68c8f322007e0522947a
tree327a52ee6b11fd95134d70b329fe567a196843f6
parentb48f983ec34683c5ce2a859e6eddfb1724885af7
Repair longstanding violation of SQL92 semantics: GROUP BY would
interpret a column name as an output column alias (targetlist AS name),
ather than a real column name as it ought to.  According to the spec,
only ORDER BY should look at output column names.  I left in GROUP BY's
willingness to use an output column number ('GROUP BY 2'), even though
this is also contrary to the spec --- again, only ORDER BY is supposed
to accept that.  But there is no possible reason to want to GROUP BY
an integer constant, so keeping this old behavior won't break any
SQL-compliant queries.  DISTINCT ON will behave the same as GROUP BY.

Change numerology regress test, which depended on the incorrect
behavior.
src/backend/parser/parse_clause.c
src/test/regress/expected/numerology.out
src/test/regress/sql/numerology.sql