@@ -8892,6 +8892,16 @@ get_oper_expr(OpExpr *expr, deparse_context *context)
88928892 appendStringInfoChar (buf , ')' );
88938893}
88948894
8895+ static void
8896+ get_func_opts (FuncFormat aggformat , Node * aggformatopts , deparse_context * context )
8897+ {
8898+ switch (aggformat )
8899+ {
8900+ default :
8901+ break ;
8902+ }
8903+ }
8904+
88958905/*
88968906 * get_func_expr - Parse back a FuncExpr node
88978907 */
@@ -8906,6 +8916,7 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89068916 List * argnames ;
89078917 bool use_variadic ;
89088918 ListCell * l ;
8919+ const char * funcname ;
89098920
89108921 /*
89118922 * If the function call came from an implicit coercion, then just show the
@@ -8960,12 +8971,19 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89608971 nargs ++ ;
89618972 }
89628973
8963- appendStringInfo (buf , "%s(" ,
8964- generate_function_name (funcoid , nargs ,
8965- argnames , argtypes ,
8966- expr -> funcvariadic ,
8967- & use_variadic ,
8968- context -> special_exprkind ));
8974+ switch (expr -> funcformat2 )
8975+ {
8976+ default :
8977+ funcname = generate_function_name (funcoid , nargs ,
8978+ argnames , argtypes ,
8979+ expr -> funcvariadic ,
8980+ & use_variadic ,
8981+ context -> special_exprkind );
8982+ break ;
8983+ }
8984+
8985+ appendStringInfo (buf , "%s(" , funcname );
8986+
89698987 nargs = 0 ;
89708988 foreach (l , expr -> args )
89718989 {
@@ -8975,6 +8993,9 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89758993 appendStringInfoString (buf , "VARIADIC " );
89768994 get_rule_expr ((Node * ) lfirst (l ), context , true);
89778995 }
8996+
8997+ get_func_opts (expr -> funcformat2 , expr -> funcformatopts , context );
8998+
89788999 appendStringInfoChar (buf , ')' );
89799000}
89809001
@@ -9073,6 +9094,8 @@ get_agg_expr(Aggref *aggref, deparse_context *context,
90739094 }
90749095 }
90759096
9097+ get_func_opts (aggref -> aggformat , aggref -> aggformatopts , context );
9098+
90769099 if (aggref -> aggfilter != NULL )
90779100 {
90789101 appendStringInfoString (buf , ") FILTER (WHERE " );
@@ -9139,6 +9162,8 @@ get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
91399162 else
91409163 get_rule_expr ((Node * ) wfunc -> args , context , true);
91419164
9165+ get_func_opts (wfunc -> winformat , wfunc -> winformatopts , context );
9166+
91429167 if (wfunc -> aggfilter != NULL )
91439168 {
91449169 appendStringInfoString (buf , ") FILTER (WHERE " );
0 commit comments