Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding parser support for AT TIME ZONE #215

18 changes: 14 additions & 4 deletions src/backend/parser/gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -14539,10 +14539,20 @@ a_expr: c_expr { $$ = $1; }
}
| a_expr AT TIME ZONE a_expr %prec AT
{
$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
if(sql_dialect == SQL_DIALECT_TSQL)
hash-16 marked this conversation as resolved.
Show resolved Hide resolved
{
$$ = (Node *) makeFuncCall(list_make2(makeString("sys"), makeString("timezone")),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
}
else
{
$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
}
}
/*
* These operators must be called out explicitly in order to make use
Expand Down