Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0dac5b5

Browse files
committed
Tweak targetlist-SRF tests some more.
Seems like it would be good to have a test case documenting theexisting behavior for non-top-level SRFs.
1 parent6415ba5 commit0dac5b5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎src/test/regress/expected/tsrf.out

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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?)
376376
VALUES(1, generate_series(1,2));
377377
ERROR: 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.

‎src/test/regress/sql/tsrf.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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?)
8181
VALUES(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.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp