index 0fc5b13d015bd6b80293914213e6e2f4cf2af68e..f67ef0c9caf206ad9376f232233896be1993bf8d 100644 (file)
}
| a_expr AT TIME ZONE a_expr %prec AT
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("timezone");
- n->args = list_make2(5,ドル 1ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
- $$ = (Node *) n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
+ list_make2(5,ドル 1ドル),
+ @2);
}
/*
* These operators must be called out explicitly in order to make use
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", 1,ドル 3,ドル @2); }
| a_expr LIKE a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("like_escape");
- n->args = list_make2(3,ドル 5ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
+ list_make2(3,ドル 5ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", 1,ドル (Node *) n, @2);
}
| a_expr NOT LIKE a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", 1,ドル 4,ドル @2); }
| a_expr NOT LIKE a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("like_escape");
- n->args = list_make2(4,ドル 6ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
+ list_make2(4,ドル 6ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", 1,ドル (Node *) n, @2);
}
| a_expr ILIKE a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", 1,ドル 3,ドル @2); }
| a_expr ILIKE a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("like_escape");
- n->args = list_make2(3,ドル 5ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
+ list_make2(3,ドル 5ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", 1,ドル (Node *) n, @2);
}
| a_expr NOT ILIKE a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", 1,ドル 4,ドル @2); }
| a_expr NOT ILIKE a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("like_escape");
- n->args = list_make2(4,ドル 6ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
+ list_make2(4,ドル 6ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", 1,ドル (Node *) n, @2);
}
| a_expr SIMILAR TO a_expr %prec SIMILAR
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("similar_escape");
- n->args = list_make2(4,ドル makeNullAConst(-1));
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"),
+ list_make2(4,ドル makeNullAConst(-1)),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", 1,ドル (Node *) n, @2);
}
| a_expr SIMILAR TO a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("similar_escape");
- n->args = list_make2(4,ドル 6ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"),
+ list_make2(4,ドル 6ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", 1,ドル (Node *) n, @2);
}
| a_expr NOT SIMILAR TO a_expr %prec SIMILAR
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("similar_escape");
- n->args = list_make2(5,ドル makeNullAConst(-1));
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"),
+ list_make2(5,ドル makeNullAConst(-1)),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", 1,ドル (Node *) n, @2);
}
| a_expr NOT SIMILAR TO a_expr ESCAPE a_expr
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("similar_escape");
- n->args = list_make2(5,ドル 7ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @2;
+ FuncCall *n = makeFuncCall(SystemFuncName("similar_escape"),
+ list_make2(5,ドル 7ドル),
+ @2);
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", 1,ドル (Node *) n, @2);
}
func_application: func_name '(' ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(1,ドル NIL, @1);
}
| func_name '(' func_arg_list ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(1,ドル 3,ドル @1);
}
| func_name '(' VARIADIC func_arg_expr ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = list_make1(4ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
+ FuncCall *n = makeFuncCall(1,ドル list_make1(4ドル), @1);
n->func_variadic = TRUE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
| func_name '(' func_arg_list ',' VARIADIC func_arg_expr ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = lappend(3,ドル 6ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
+ FuncCall *n = makeFuncCall(1,ドル lappend(3,ドル 6ドル), @1);
n->func_variadic = TRUE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
| func_name '(' func_arg_list sort_clause ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = 3ドル;
+ FuncCall *n = makeFuncCall(1,ドル 3,ドル @1);
n->agg_order = 4ドル;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
| func_name '(' ALL func_arg_list opt_sort_clause ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = 4ドル;
+ FuncCall *n = makeFuncCall(1,ドル 4,ドル @1);
n->agg_order = 5ドル;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
/* Ideally we'd mark the FuncCall node to indicate
* "must be an aggregate", but there's no provision
* for that in FuncCall at the moment.
*/
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
| func_name '(' DISTINCT func_arg_list opt_sort_clause ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = 4ドル;
+ FuncCall *n = makeFuncCall(1,ドル 4,ドル @1);
n->agg_order = 5ドル;
- n->agg_star = FALSE;
n->agg_distinct = TRUE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
| func_name '(' '*' ')'
* so that later processing can detect what the argument
* really was.
*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = 1ドル;
- n->args = NIL;
- n->agg_order = NIL;
+ FuncCall *n = makeFuncCall(1,ドル NIL, @1);
n->agg_star = TRUE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
$$ = (Node *)n;
}
;
func_expr_common_subexpr:
COLLATION FOR '(' a_expr ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("pg_collation_for");
- n->args = list_make1(4ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"),
+ list_make1(4ドル),
+ @1);
}
| CURRENT_DATE
{
* Translate as "now()", since we have a function that
* does exactly what is needed.
*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("now");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("now"), NIL, @1);
}
| CURRENT_TIMESTAMP '(' Iconst ')'
{
}
| CURRENT_ROLE
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("current_user");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, @1);
}
| CURRENT_USER
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("current_user");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, @1);
}
| SESSION_USER
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("session_user");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("session_user"), NIL, @1);
}
| USER
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("current_user");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("current_user"), NIL, @1);
}
| CURRENT_CATALOG
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("current_database");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("current_database"), NIL, @1);
}
| CURRENT_SCHEMA
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("current_schema");
- n->args = NIL;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("current_schema"), NIL, @1);
}
| CAST '(' a_expr AS Typename ')'
{ $$ = makeTypeCast(3,ドル 5,ドル @1); }
| EXTRACT '(' extract_list ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("date_part");
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("date_part"), 3,ドル @1);
}
| OVERLAY '(' overlay_list ')'
{
* overlay(A PLACING B FROM C) is converted to
* overlay(A, B, C)
*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("overlay");
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("overlay"), 3,ドル @1);
}
| POSITION '(' position_list ')'
{
/* position(A in B) is converted to position(B, A) */
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("position");
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("position"), 3,ドル @1);
}
| SUBSTRING '(' substr_list ')'
{
/* substring(A from B for C) is converted to
* substring(A, B, C) - thomas 2000年11月28日
*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("substring");
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("substring"), 3,ドル @1);
}
| TREAT '(' a_expr AS Typename ')'
{
* In SQL99, this is intended for use with structured UDTs,
* but let's make this a generally useful form allowing stronger
* coercions than are handled by implicit casting.
- */
- FuncCall *n = makeNode(FuncCall);
- /* Convert SystemTypeName() to SystemFuncName() even though
+ *
+ * Convert SystemTypeName() to SystemFuncName() even though
* at the moment they result in the same thing.
*/
- n->funcname = SystemFuncName(((Value *)llast(5ドル->names))->val.str);
- n->args = list_make1(3ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName(((Value *)llast(5ドル->names))->val.str),
+ list_make1(3ドル),
+ @1);
}
| TRIM '(' BOTH trim_list ')'
{
/* various trim expressions are defined in SQL
* - thomas 1997年07月19日
*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("btrim");
- n->args = 4ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("btrim"), 4,ドル @1);
}
| TRIM '(' LEADING trim_list ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("ltrim");
- n->args = 4ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("ltrim"), 4,ドル @1);
}
| TRIM '(' TRAILING trim_list ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("rtrim");
- n->args = 4ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("rtrim"), 4,ドル @1);
}
| TRIM '(' trim_list ')'
{
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("btrim");
- n->args = 3ドル;
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("btrim"), 3,ドル @1);
}
| NULLIF '(' a_expr ',' a_expr ')'
{
{
/* xmlexists(A PASSING [BY REF] B [BY REF]) is
* converted to xmlexists(A, B)*/
- FuncCall *n = makeNode(FuncCall);
- n->funcname = SystemFuncName("xmlexists");
- n->args = list_make2(3,ドル 4ドル);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = @1;
- $$ = (Node *)n;
+ $$ = (Node *) makeFuncCall(SystemFuncName("xmlexists"), list_make2(3,ドル 4ドル), @1);
}
| XMLFOREST '(' xml_attribute_list ')'
{
static FuncCall *
makeOverlaps(List *largs, List *rargs, int location, core_yyscan_t yyscanner)
{
- FuncCall *n = makeNode(FuncCall);
-
- n->funcname = SystemFuncName("overlaps");
+ FuncCall *n;
if (list_length(largs) == 1)
largs = lappend(largs, largs);
else if (list_length(largs) != 2)
@@ -13334,13 +13060,7 @@ makeOverlaps(List *largs, List *rargs, int location, core_yyscan_t yyscanner)
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("wrong number of parameters on right side of OVERLAPS expression"),
parser_errposition(location)));
- n->args = list_concat(largs, rargs);
- n->agg_order = NIL;
- n->agg_star = FALSE;
- n->agg_distinct = FALSE;
- n->func_variadic = FALSE;
- n->over = NULL;
- n->location = location;
+ n = makeFuncCall(SystemFuncName("overlaps"), list_concat(largs, rargs), location);
return n;
}