From: Tom Lane Date: Tue, 31 Jan 2006 22:40:12 +0000 (+0000) Subject: Allow %TYPE to be used with SETOF, per gripe from Murat Tasan. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=a9bd520d65f6f7618e7737bdda29155e64b7143b;p=users%2Fbernd%2Fpostgres.git Allow %TYPE to be used with SETOF, per gripe from Murat Tasan. --- diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 27f2fc7765..4673c7dd5c 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -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; + } ;