File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,17 @@ LINE 1: INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3)...
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
378+ -- We allow tSRFs that are not at top level
379+ SELECT int4mul(generate_series(1,2), 10);
380+ int4mul
381+ ---------
382+ 10
383+ 20
384+ (2 rows)
385+
386+ -- but SRFs in function RTEs must be at top level (annoying restriction)
387+ SELECT * FROM int4mul(generate_series(1,2), 10);
388+ ERROR: set-valued function called in context that cannot accept a set
378389-- DISTINCT ON is evaluated before tSRF evaluation if SRF is not
379390-- referenced either in ORDER BY or in the DISTINCT ON list. The ORDER
380391-- BY reference can be implicitly generated, if there's no other ORDER BY.
Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3);
8080-- nor standalone VALUES (but surely this is a bug?)
8181VALUES (1 , generate_series(1 ,2 ));
8282
83+ -- We allow tSRFs that are not at top level
84+ SELECT int4mul(generate_series(1 ,2 ), 10 );
85+
86+ -- but SRFs in function RTEs must be at top level (annoying restriction)
87+ SELECT * FROM int4mul(generate_series(1 ,2 ), 10 );
88+
8389-- DISTINCT ON is evaluated before tSRF evaluation if SRF is not
8490-- referenced either in ORDER BY or in the DISTINCT ON list. The ORDER
8591-- BY reference can be implicitly generated, if there's no other ORDER BY.
You can’t perform that action at this time.
0 commit comments