@ -11361,10 +11361,10 @@ func_expr: func_application within_group_clause filter_clause over_clause
;
;
/*
/*
* As func_expr but does not accept WINDOW functions directly (they
* As func_expr but does not accept WINDOW functions directly
* can still be contained in arguments for functions etc. )
* (but they can still be contained in arguments for functions etc).
* Use this when window expressions are not allowed, so to disambiguate
* Use this when window expressions are not allowed, where needed to
* the grammar. (e.g. in CREATE INDEX)
* disambiguate the grammar (e.g. in CREATE INDEX).
*/
*/
func_expr_windowless:
func_expr_windowless:
func_application { $$ = $1; }
func_application { $$ = $1; }
@ -11372,7 +11372,7 @@ func_expr_windowless:
;
;
/*
/*
* Special expression
* Special expressions that are considered to be functions.
*/
*/
func_expr_common_subexpr:
func_expr_common_subexpr:
COLLATION FOR '(' a_expr ')'
COLLATION FOR '(' a_expr ')'
@ -11397,10 +11397,15 @@ func_expr_common_subexpr:
* of type-input conversion functions. (As of PG 7.3
* of type-input conversion functions. (As of PG 7.3
* that is actually possible, but not clear that we want
* that is actually possible, but not clear that we want
* to rely on it.)
* to rely on it.)
*
* The token location is attached to the run-time
* typecast, not to the Const, for the convenience of
* pg_stat_statements (which doesn't want these constructs
* to appear to be replaceable constants).
*/
*/
Node *n;
Node *n;
n = makeStringConstCast("now", @1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
$$ = makeTypeCast(n, SystemTypeName("date"), -1);
$$ = makeTypeCast(n, SystemTypeName("date"), @ 1);
}
}
| CURRENT_TIME
| CURRENT_TIME
{
{
@ -11409,8 +11414,8 @@ func_expr_common_subexpr:
* See comments for CURRENT_DATE.
* See comments for CURRENT_DATE.
*/
*/
Node *n;
Node *n;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
$$ = makeTypeCast(n, SystemTypeName("timetz"), - 1);
$$ = makeTypeCast(n, SystemTypeName("timetz"), @ 1);
}
}
| CURRENT_TIME '(' Iconst ')'
| CURRENT_TIME '(' Iconst ')'
{
{
@ -11420,10 +11425,10 @@ func_expr_common_subexpr:
*/
*/
Node *n;
Node *n;
TypeName *d;
TypeName *d;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
d = SystemTypeName("timetz");
d = SystemTypeName("timetz");
d->typmods = list_make1(makeIntConst($3, @3));
d->typmods = list_make1(makeIntConst($3, @3));
$$ = makeTypeCast(n, d, - 1);
$$ = makeTypeCast(n, d, @ 1);
}
}
| CURRENT_TIMESTAMP
| CURRENT_TIMESTAMP
{
{
@ -11441,10 +11446,10 @@ func_expr_common_subexpr:
*/
*/
Node *n;
Node *n;
TypeName *d;
TypeName *d;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
d = SystemTypeName("timestamptz");
d = SystemTypeName("timestamptz");
d->typmods = list_make1(makeIntConst($3, @3));
d->typmods = list_make1(makeIntConst($3, @3));
$$ = makeTypeCast(n, d, - 1);
$$ = makeTypeCast(n, d, @ 1);
}
}
| LOCALTIME
| LOCALTIME
{
{
@ -11453,8 +11458,8 @@ func_expr_common_subexpr:
* See comments for CURRENT_DATE.
* See comments for CURRENT_DATE.
*/
*/
Node *n;
Node *n;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
$$ = makeTypeCast((Node *)n, SystemTypeName("time"), - 1);
$$ = makeTypeCast((Node *)n, SystemTypeName("time"), @ 1);
}
}
| LOCALTIME '(' Iconst ')'
| LOCALTIME '(' Iconst ')'
{
{
@ -11464,10 +11469,10 @@ func_expr_common_subexpr:
*/
*/
Node *n;
Node *n;
TypeName *d;
TypeName *d;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
d = SystemTypeName("time");
d = SystemTypeName("time");
d->typmods = list_make1(makeIntConst($3, @3));
d->typmods = list_make1(makeIntConst($3, @3));
$$ = makeTypeCast((Node *)n, d, - 1);
$$ = makeTypeCast((Node *)n, d, @ 1);
}
}
| LOCALTIMESTAMP
| LOCALTIMESTAMP
{
{
@ -11476,8 +11481,8 @@ func_expr_common_subexpr:
* See comments for CURRENT_DATE.
* See comments for CURRENT_DATE.
*/
*/
Node *n;
Node *n;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
$$ = makeTypeCast(n, SystemTypeName("timestamp"), - 1);
$$ = makeTypeCast(n, SystemTypeName("timestamp"), @ 1);
}
}
| LOCALTIMESTAMP '(' Iconst ')'
| LOCALTIMESTAMP '(' Iconst ')'
{
{
@ -11487,10 +11492,10 @@ func_expr_common_subexpr:
*/
*/
Node *n;
Node *n;
TypeName *d;
TypeName *d;
n = makeStringConstCast("now", @ 1, SystemTypeName("text"));
n = makeStringConstCast("now", - 1, SystemTypeName("text"));
d = SystemTypeName("timestamp");
d = SystemTypeName("timestamp");
d->typmods = list_make1(makeIntConst($3, @3));
d->typmods = list_make1(makeIntConst($3, @3));
$$ = makeTypeCast(n, d, - 1);
$$ = makeTypeCast(n, d, @ 1);
}
}
| CURRENT_ROLE
| CURRENT_ROLE
{
{