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

Commitcc80f0a

Browse files
committed
Remove ancient restriction that LIMIT/OFFSET can't contain a sub-select.
This was probably protecting some implementation limitation when it wasput in, but as far as I can tell the planner and executor have no suchassumption anymore; the case seems to work fine. Per a gripe fromGrzegorz Jaskiewicz.
1 parentefac279 commitcc80f0a

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

‎src/backend/parser/parse_clause.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.168 2008/01/0119:45:50 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.169 2008/02/15 17:19:46 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1091,9 +1091,7 @@ transformLimitClause(ParseState *pstate, Node *clause,
10911091
qual=coerce_to_specific_type(pstate,qual,INT8OID,constructName);
10921092

10931093
/*
1094-
* LIMIT can't refer to any vars or aggregates of the current query; we
1095-
* don't allow subselects either (though that case would at least be
1096-
* sensible)
1094+
* LIMIT can't refer to any vars or aggregates of the current query
10971095
*/
10981096
if (contain_vars_of_level(qual,0))
10991097
{
@@ -1111,14 +1109,6 @@ transformLimitClause(ParseState *pstate, Node *clause,
11111109
errmsg("argument of %s must not contain aggregates",
11121110
constructName)));
11131111
}
1114-
if (contain_subplans(qual))
1115-
{
1116-
ereport(ERROR,
1117-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1118-
/* translator: %s is name of a SQL construct, eg LIMIT */
1119-
errmsg("argument of %s must not contain subqueries",
1120-
constructName)));
1121-
}
11221112

11231113
returnqual;
11241114
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp