Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6851bae

Browse files
committed
Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.
1 parent 8a1468a commit 6851bae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/backend/parser/gram.y

+10-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.524 2006/01/22 20:03:16 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.525 2006/01/31 22:40:03 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -3672,7 +3672,7 @@ func_return:
36723672
;
36733673

36743674
/*
3675-
* We would like to make the second production here be ColId attrs etc,
3675+
* We would like to make the %TYPE productions here be ColId attrs etc,
36763676
* but that causes reduce/reduce conflicts. type_name is next best choice.
36773677
*/
36783678
func_type: Typename { $$ = $1; }
@@ -3683,6 +3683,14 @@ func_type: Typename { $$ = $1; }
36833683
$$->pct_type = true;
36843684
$$->typmod = -1;
36853685
}
3686+
| SETOF type_name attrs '%' TYPE_P
3687+
{
3688+
$$ = makeNode(TypeName);
3689+
$$->names = lcons(makeString($2), $3);
3690+
$$->pct_type = true;
3691+
$$->typmod = -1;
3692+
$$->setof = TRUE;
3693+
}
36863694
;
36873695

36883696

0 commit comments

Comments
 (0)