From: Tom Lane Date: Mon, 6 Jul 2009 02:58:40 +0000 (+0000) Subject: Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allow X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=4b25a7ef2b4bdbf160393c881bece7597baea1d3;p=users%2Fsimon%2Fpostgres.git Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allow parentheses around the that follows a WITH clause, eg with cte(foo) as ( values(0) ) ((select foo from cte)); This seems to be just an oversight/thinko in gram.y. Noted while experimenting with bug #4902. --- diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ac17b93bf6..20ab0bac2a 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6879,7 +6879,7 @@ select_no_parens: NULL); $$ = $1; } - | with_clause simple_select + | with_clause select_clause { insertSelectOptions((SelectStmt *) $2, NULL, NIL, NULL, NULL,