aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/numerology.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/numerology.out')
-rw-r--r--src/test/regress/expected/numerology.out28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/test/regress/expected/numerology.out b/src/test/regress/expected/numerology.out
index 131e5f7e64b..8e13a9e6acb 100644
--- a/src/test/regress/expected/numerology.out
+++ b/src/test/regress/expected/numerology.out
@@ -88,7 +88,7 @@ SELECT DISTINCT f1 AS two FROM TEMP_GROUP;
SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
FROM TEMP_GROUP
- GROUP BY two
+ GROUP BY f1
ORDER BY two, max_float, min_float;
two | max_float | min_float
-----+----------------------+-----------------------
@@ -96,19 +96,17 @@ 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.
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;
- two | max_float | min_float
------+----------------------+-----------------------
- 1 | 1.2345678901234e+200 | 0
- 2 | 0 | -1.2345678901234e+200
-(2 rows)
-
+ERROR: Attribute 'two' not found
SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
FROM TEMP_GROUP
- GROUP BY two
+ GROUP BY f1
ORDER BY two, min_minus_1;
two | max_plus_1 | min_minus_1
-----+----------------------+-----------------------
@@ -116,14 +114,16 @@ SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
2 | 1 | -1.2345678901234e+200
(2 rows)
-SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+SELECT f1 AS two,
+ max(f2) + min(f2) AS max_plus_min,
+ min(f3) - 1 AS min_minus_1
FROM TEMP_GROUP
- GROUP BY two
+ GROUP BY f1
ORDER BY two, min_minus_1;
- two | max_plus_1 | min_minus_1
------+----------------------+-----------------------
- 1 | 1.2345678901234e+200 | -1
- 2 | 1 | -1.2345678901234e+200
+ two | max_plus_min | min_minus_1
+-----+--------------+-----------------------
+ 1 | 0 | -1
+ 2 | 0 | -1.2345678901234e+200
(2 rows)
DROP TABLE TEMP_INT2;