提交 6851baed 编写于 作者: T Tom Lane

Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.

上级 8a1468af
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.524 2006/01/22 20:03:16 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.525 2006/01/31 22:40:03 tgl Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -3672,7 +3672,7 @@ func_return: ...@@ -3672,7 +3672,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. * but that causes reduce/reduce conflicts. type_name is next best choice.
*/ */
func_type: Typename { $$ = $1; } func_type: Typename { $$ = $1; }
...@@ -3683,6 +3683,14 @@ func_type: Typename { $$ = $1; } ...@@ -3683,6 +3683,14 @@ func_type: Typename { $$ = $1; }
$$->pct_type = true; $$->pct_type = true;
$$->typmod = -1; $$->typmod = -1;
} }
| SETOF type_name attrs '%' TYPE_P
{
$$ = makeNode(TypeName);
$$->names = lcons(makeString($2), $3);
$$->pct_type = true;
$$->typmod = -1;
$$->setof = TRUE;
}
; ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册