aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-15 17:19:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-15 17:19:46 +0000
commitcc80f0a340cdeba7716c5e128346481b82cc6949 (patch)
tree604232ad7e38cb47c469c92e61a343d1d7538a08 /src/backend/parser/parse_clause.c
parentefac2796e64f50f899c49524289d92afa89f1fc8 (diff)
downloadpostgresql-cc80f0a340cdeba7716c5e128346481b82cc6949.tar.gz
postgresql-cc80f0a340cdeba7716c5e128346481b82cc6949.zip
Remove ancient restriction that LIMIT/OFFSET can't contain a sub-select.
This was probably protecting some implementation limitation when it was put in, but as far as I can tell the planner and executor have no such assumption anymore; the case seems to work fine. Per a gripe from Grzegorz Jaskiewicz.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 9fce0f66299..e5a23aaa445 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.168 2008/01/01 19:45:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.169 2008/02/15 17:19:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1091,9 +1091,7 @@ transformLimitClause(ParseState *pstate, Node *clause,
qual = coerce_to_specific_type(pstate, qual, INT8OID, constructName);
/*
- * LIMIT can't refer to any vars or aggregates of the current query; we
- * don't allow subselects either (though that case would at least be
- * sensible)
+ * LIMIT can't refer to any vars or aggregates of the current query
*/
if (contain_vars_of_level(qual, 0))
{
@@ -1111,14 +1109,6 @@ transformLimitClause(ParseState *pstate, Node *clause,
errmsg("argument of %s must not contain aggregates",
constructName)));
}
- if (contain_subplans(qual))
- {
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- /* translator: %s is name of a SQL construct, eg LIMIT */
- errmsg("argument of %s must not contain subqueries",
- constructName)));
- }
return qual;
}