From e353e73768e54c7e5cfd5a1d6e97e1f6315207bb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 25 Sep 2000 18:38:39 +0000 Subject: [PATCH] Correct error in grammar for subselect-in-FROM: SQL spec does not allow omission of alias_clause for a subselect. --- src/backend/parser/gram.y | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index a422bf705a..93aa912f45 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.191 2000/09/19 18:17:55 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.192 2000/09/25 18:38:39 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -3751,6 +3751,10 @@ from_list: from_list ',' table_ref { $$ = lappend($1, $3); } * between table_ref := '(' joined_table ')' alias_clause * and joined_table := '(' joined_table ')'. So, we must have the * redundant-looking productions here instead. + * + * Note that the SQL spec does not permit a subselect () + * without an alias clause, so we don't either. This avoids the problem + * of needing to invent a refname for an unlabeled subselect. */ table_ref: relation_expr { @@ -3761,13 +3765,6 @@ table_ref: relation_expr $1->name = $2; $$ = (Node *) $1; } - | '(' select_clause ')' - { - RangeSubselect *n = makeNode(RangeSubselect); - n->subquery = $2; - n->name = NULL; - $$ = (Node *) n; - } | '(' select_clause ')' alias_clause { RangeSubselect *n = makeNode(RangeSubselect); -- 2.40.0