mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
Tweak targetlist-SRF tests.
Add a test case showing that we don't support SRFs in window-function arguments. Remove a duplicate test case for SRFs in aggregate arguments.
This commit is contained in:
parent
55c3391d1e
commit
a163c006ca
@ -159,6 +159,9 @@ SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest
|
|||||||
-- SRFs are not allowed in aggregate arguments
|
-- SRFs are not allowed in aggregate arguments
|
||||||
SELECT min(generate_series(1, 3)) FROM few;
|
SELECT min(generate_series(1, 3)) FROM few;
|
||||||
ERROR: set-valued function called in context that cannot accept a set
|
ERROR: set-valued function called in context that cannot accept a set
|
||||||
|
-- SRFs are not allowed in window function arguments, either
|
||||||
|
SELECT min(generate_series(1, 3)) OVER() FROM few;
|
||||||
|
ERROR: set-valued function called in context that cannot accept a set
|
||||||
-- SRFs are normally computed after window functions
|
-- SRFs are normally computed after window functions
|
||||||
SELECT id,lag(id) OVER(), count(*) OVER(), generate_series(1,3) FROM few;
|
SELECT id,lag(id) OVER(), count(*) OVER(), generate_series(1,3) FROM few;
|
||||||
id | lag | count | generate_series
|
id | lag | count | generate_series
|
||||||
@ -369,9 +372,6 @@ INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3);
|
|||||||
ERROR: set-returning functions are not allowed in RETURNING
|
ERROR: set-returning functions are not allowed in RETURNING
|
||||||
LINE 1: INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3)...
|
LINE 1: INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3)...
|
||||||
^
|
^
|
||||||
-- nor aggregate arguments
|
|
||||||
SELECT count(generate_series(1,3)) FROM few;
|
|
||||||
ERROR: set-valued function called in context that cannot accept a set
|
|
||||||
-- nor standalone VALUES (but surely this is a bug?)
|
-- nor standalone VALUES (but surely this is a bug?)
|
||||||
VALUES(1, generate_series(1,2));
|
VALUES(1, generate_series(1,2));
|
||||||
ERROR: set-valued function called in context that cannot accept a set
|
ERROR: set-valued function called in context that cannot accept a set
|
||||||
|
@ -47,6 +47,9 @@ SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest
|
|||||||
-- SRFs are not allowed in aggregate arguments
|
-- SRFs are not allowed in aggregate arguments
|
||||||
SELECT min(generate_series(1, 3)) FROM few;
|
SELECT min(generate_series(1, 3)) FROM few;
|
||||||
|
|
||||||
|
-- SRFs are not allowed in window function arguments, either
|
||||||
|
SELECT min(generate_series(1, 3)) OVER() FROM few;
|
||||||
|
|
||||||
-- SRFs are normally computed after window functions
|
-- SRFs are normally computed after window functions
|
||||||
SELECT id,lag(id) OVER(), count(*) OVER(), generate_series(1,3) FROM few;
|
SELECT id,lag(id) OVER(), count(*) OVER(), generate_series(1,3) FROM few;
|
||||||
-- unless referencing SRFs
|
-- unless referencing SRFs
|
||||||
@ -73,8 +76,7 @@ UPDATE fewmore SET data = generate_series(4,9);
|
|||||||
|
|
||||||
-- SRFs are not allowed in RETURNING
|
-- SRFs are not allowed in RETURNING
|
||||||
INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3);
|
INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3);
|
||||||
-- nor aggregate arguments
|
|
||||||
SELECT count(generate_series(1,3)) FROM few;
|
|
||||||
-- nor standalone VALUES (but surely this is a bug?)
|
-- nor standalone VALUES (but surely this is a bug?)
|
||||||
VALUES(1, generate_series(1,2));
|
VALUES(1, generate_series(1,2));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user