diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 68ec391238bdf7914dbaf930ac9147bafdd5ca02..ea3c60a3eedddb47c6e905cab50923638f21328b 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.110 2008/11/20 14:04:45 petere Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.111 2008/11/21 11:47:55 petere Exp $
 PostgreSQL documentation
 -->
 
@@ -59,7 +59,7 @@ and <replaceable class="parameter">with_query</replaceable> is:
 
     <replaceable class="parameter">with_query_name</replaceable> [ ( <replaceable class="parameter">column_name</replaceable> [, ...] ) ] AS ( <replaceable class="parameter">select</replaceable> )
 
-TABLE <replaceable class="parameter">table_name</replaceable> | <replaceable class="parameter">with_query_name</replaceable>
+TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] | <replaceable class="parameter">with_query_name</replaceable>
 </synopsis>
 
  </refsynopsisdiv>
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 6733372da2d6ec7811bea0725b50dcdf2dd51e7d..eaf72f702628316dcc745f0455f11a7e1d2c08e2 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *	  $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.638 2008/11/20 14:04:46 petere Exp $
+ *	  $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.639 2008/11/21 11:47:55 petere Exp $
  *
  * HISTORY
  *	  AUTHOR			DATE			MAJOR EVENT
@@ -6431,9 +6431,9 @@ simple_select:
 					$$ = (Node *)n;
 				}
 			| values_clause							{ $$ = $1; }
-			| TABLE qualified_name
+			| TABLE relation_expr
 				{
-					/* same as SELECT * FROM qualified_name */
+					/* same as SELECT * FROM relation_expr */
 					ColumnRef *cr = makeNode(ColumnRef);
 					ResTarget *rt = makeNode(ResTarget);
 					SelectStmt *n = makeNode(SelectStmt);
@@ -6446,9 +6446,6 @@ simple_select:
 					rt->val = (Node *)cr;
 					rt->location = -1;
 
-					$2->inhOpt = INH_DEFAULT;
-					$2->alias = NULL;
-
 					n->targetList = list_make1(rt);
 					n->fromClause = list_make1($2);
 					$$ = (Node *)n;