@@ -159,6 +159,9 @@ SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest
159159-- SRFs are not allowed in aggregate arguments
160160SELECT min(generate_series(1, 3)) FROM few;
161161ERROR: set-valued function called in context that cannot accept a set
162+ -- SRFs are not allowed in window function arguments, either
163+ SELECT min(generate_series(1, 3)) OVER() FROM few;
164+ ERROR: set-valued function called in context that cannot accept a set
162165-- SRFs are normally computed after window functions
163166SELECT id,lag(id) OVER(), count(*) OVER(), generate_series(1,3) FROM few;
164167 id | lag | count | generate_series
@@ -369,9 +372,6 @@ INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3);
369372ERROR: set-returning functions are not allowed in RETURNING
370373LINE 1: INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3)...
371374 ^
372- -- nor aggregate arguments
373- SELECT count(generate_series(1,3)) FROM few;
374- ERROR: set-valued function called in context that cannot accept a set
375375-- nor standalone VALUES (but surely this is a bug?)
376376VALUES(1, generate_series(1,2));
377377ERROR: set-valued function called in context that cannot accept a set
0 commit comments