diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-03-15 23:31:19 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-03-15 23:31:19 +0000 |
| commit | 1763a7c1ea3c609bae327f4c6be7cecc7cdee006 (patch) | |
| tree | f73eb8bb4a347c764d21b76092f679b684e9326b /src/test/regress/expected/numerology.out | |
| parent | 8e0790519a54e775f4d3a6ae3c6da560d0869d66 (diff) | |
| download | postgresql-1763a7c1ea3c609bae327f4c6be7cecc7cdee006.tar.gz | |
Tweak GROUP BY so that it will still accept result-column names, but only
after trying to resolve the item as an input-column name. This allows us
to be compliant with the SQL92 spec for queries that fall within the spec,
while still accepting the same out-of-spec queries as 6.5 did. You'll only
lose if there is an output column name that is the same as an input
column name, but doesn't refer to the same value. 7.0 will interpret
such a GROUP BY spec differently than 6.5 did. No way around that, because
6.5 was clearly not spec compliant.
Diffstat (limited to 'src/test/regress/expected/numerology.out')
| -rw-r--r-- | src/test/regress/expected/numerology.out | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/regress/expected/numerology.out b/src/test/regress/expected/numerology.out index 8e13a9e6ac..c5ad36fdd3 100644 --- a/src/test/regress/expected/numerology.out +++ b/src/test/regress/expected/numerology.out @@ -96,14 +96,18 @@ SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float 2 | 0 | -1.2345678901234e+200 (2 rows) --- Postgres used to accept this, but it is clearly against SQL92 to --- interpret GROUP BY arguments as result column names; they should --- be source column names *only*. An error is expected. +-- GROUP BY a result column name is not legal per SQL92, but we accept it +-- anyway (if the name is not the name of any column exposed by FROM). SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float FROM TEMP_GROUP GROUP BY two ORDER BY two, max_float, min_float; -ERROR: Attribute 'two' not found + two | max_float | min_float +-----+----------------------+----------------------- + 1 | 1.2345678901234e+200 | 0 + 2 | 0 | -1.2345678901234e+200 +(2 rows) + SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1 FROM TEMP_GROUP GROUP BY f1 |
