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-Tag: REL8_1_3~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2aa231be9ec94204856e59c7cd316b78e24da4d4;p=thirdparty%2Fpostgresql.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 db12a140e59..fd815d6c68e 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.511.2.1 2005/11/13 19:11:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.511.2.2 2006/01/31 22:40:12 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -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; + } ;