Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.
authorTom Lane <[email protected]>
Tue, 31 Jan 2006 22:40:12 +0000 (22:40 +0000)
committerTom Lane <[email protected]>
Tue, 31 Jan 2006 22:40:12 +0000 (22:40 +0000)
src/backend/parser/gram.y

index 27f2fc7765121038491b75aba9c1f13be3a417f8..4673c7dd5c83f7effed108dab6f24870c2f571a3 100644 (file)
@@ -3617,7 +3617,7 @@ func_return:
                ;
 
 /*
- * We would like to make the second production here be ColId attrs etc,
+ * We would like to make the %TYPE productions here be ColId attrs etc,
  * but that causes reduce/reduce conflicts.  type_name is next best choice.
  */
 func_type:     Typename                                                                { $$ = $1; }
@@ -3628,6 +3628,14 @@ func_type:       Typename                                                                { $$ = $1; }
                                        $$->pct_type = true;
                                        $$->typmod = -1;
                                }
+                       | SETOF type_name attrs '%' TYPE_P
+                               {
+                                       $$ = makeNode(TypeName);
+                                       $$->names = lcons(makeString($2), $3);
+                                       $$->pct_type = true;
+                                       $$->typmod = -1;
+                                       $$->setof = TRUE;
+                               }
                ;