• Tom Lane's avatar
    Repair longstanding violation of SQL92 semantics: GROUP BY would · 751a14e6
    Tom Lane authored
    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.
    751a14e6
numerology.out 3.28 KB