mirror of https://github.com/citusdata/citus.git
Adds EXTRACT cases to get_func_sql_syntax in ruleutils_14.c
Relevant PG commit: a2da77cdb4661826482ebf2ddba1f953bc74afe4pull/5209/head
parent
131062d6b5
commit
84f0be56c3
|
@ -6641,6 +6641,27 @@ get_func_sql_syntax(FuncExpr *expr, deparse_context *context)
|
||||||
appendStringInfoString(buf, "))");
|
appendStringInfoString(buf, "))");
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case F_EXTRACT_TEXT_DATE:
|
||||||
|
case F_EXTRACT_TEXT_TIME:
|
||||||
|
case F_EXTRACT_TEXT_TIMETZ:
|
||||||
|
case F_EXTRACT_TEXT_TIMESTAMP:
|
||||||
|
case F_EXTRACT_TEXT_TIMESTAMPTZ:
|
||||||
|
case F_EXTRACT_TEXT_INTERVAL:
|
||||||
|
/* EXTRACT (x FROM y) */
|
||||||
|
appendStringInfoString(buf, "EXTRACT(");
|
||||||
|
{
|
||||||
|
Const *con = (Const *) linitial(expr->args);
|
||||||
|
|
||||||
|
Assert(IsA(con, Const) &&
|
||||||
|
con->consttype == TEXTOID &&
|
||||||
|
!con->constisnull);
|
||||||
|
appendStringInfoString(buf, TextDatumGetCString(con->constvalue));
|
||||||
|
}
|
||||||
|
appendStringInfoString(buf, " FROM ");
|
||||||
|
get_rule_expr((Node *) lsecond(expr->args), context, false);
|
||||||
|
appendStringInfoChar(buf, ')');
|
||||||
|
return true;
|
||||||
|
|
||||||
case F_IS_NORMALIZED:
|
case F_IS_NORMALIZED:
|
||||||
/* IS xxx NORMALIZED */
|
/* IS xxx NORMALIZED */
|
||||||
appendStringInfoString(buf, "((");
|
appendStringInfoString(buf, "((");
|
||||||
|
|
Loading…
Reference in New Issue