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

Commita163c00

Browse files
committed
Tweak targetlist-SRF tests.
Add a test case showing that we don't support SRFs in window-functionarguments. Remove a duplicate test case for SRFs in aggregate arguments.
1 parent55c3391 commita163c00

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
160160
SELECT min(generate_series(1, 3)) FROM few;
161161
ERROR: 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
163166
SELECT 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);
369372
ERROR: set-returning functions are not allowed in RETURNING
370373
LINE 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?)
376376
VALUES(1, generate_series(1,2));
377377
ERROR: set-valued function called in context that cannot accept a set

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest
4747
-- SRFs are not allowed in aggregate arguments
4848
SELECTmin(generate_series(1,3))FROM few;
4949

50+
-- SRFs are not allowed in window function arguments, either
51+
SELECTmin(generate_series(1,3)) OVER()FROM few;
52+
5053
-- SRFs are normally computed after window functions
5154
SELECT id,lag(id) OVER(),count(*) OVER(), generate_series(1,3)FROM few;
5255
-- unless referencing SRFs
@@ -73,8 +76,7 @@ UPDATE fewmore SET data = generate_series(4,9);
7376

7477
-- SRFs are not allowed in RETURNING
7578
INSERT INTO fewmoreVALUES(1) RETURNING generate_series(1,3);
76-
-- nor aggregate arguments
77-
SELECTcount(generate_series(1,3))FROM few;
79+
7880
-- nor standalone VALUES (but surely this is a bug?)
7981
VALUES(1, generate_series(1,2));
8082

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp