@@ -9045,6 +9045,16 @@ get_oper_expr(OpExpr *expr, deparse_context *context)
90459045 appendStringInfoChar (buf , ')' );
90469046}
90479047
9048+ static void
9049+ get_func_opts (FuncFormat aggformat , Node * aggformatopts , deparse_context * context )
9050+ {
9051+ switch (aggformat )
9052+ {
9053+ default :
9054+ break ;
9055+ }
9056+ }
9057+
90489058/*
90499059 * get_func_expr - Parse back a FuncExpr node
90509060 */
@@ -9059,6 +9069,7 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
90599069 List * argnames ;
90609070 bool use_variadic ;
90619071 ListCell * l ;
9072+ const char * funcname ;
90629073
90639074 /*
90649075 * If the function call came from an implicit coercion, then just show the
@@ -9113,12 +9124,19 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
91139124 nargs ++ ;
91149125 }
91159126
9116- appendStringInfo (buf , "%s(" ,
9117- generate_function_name (funcoid , nargs ,
9118- argnames , argtypes ,
9119- expr -> funcvariadic ,
9120- & use_variadic ,
9121- context -> special_exprkind ));
9127+ switch (expr -> funcformat2 )
9128+ {
9129+ default :
9130+ funcname = generate_function_name (funcoid , nargs ,
9131+ argnames , argtypes ,
9132+ expr -> funcvariadic ,
9133+ & use_variadic ,
9134+ context -> special_exprkind );
9135+ break ;
9136+ }
9137+
9138+ appendStringInfo (buf , "%s(" , funcname );
9139+
91229140 nargs = 0 ;
91239141 foreach (l , expr -> args )
91249142 {
@@ -9128,6 +9146,9 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
91289146 appendStringInfoString (buf , "VARIADIC " );
91299147 get_rule_expr ((Node * ) lfirst (l ), context , true);
91309148 }
9149+
9150+ get_func_opts (expr -> funcformat2 , expr -> funcformatopts , context );
9151+
91319152 appendStringInfoChar (buf , ')' );
91329153}
91339154
@@ -9226,6 +9247,8 @@ get_agg_expr(Aggref *aggref, deparse_context *context,
92269247 }
92279248 }
92289249
9250+ get_func_opts (aggref -> aggformat , aggref -> aggformatopts , context );
9251+
92299252 if (aggref -> aggfilter != NULL )
92309253 {
92319254 appendStringInfoString (buf , ") FILTER (WHERE " );
@@ -9292,6 +9315,8 @@ get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
92929315 else
92939316 get_rule_expr ((Node * ) wfunc -> args , context , true);
92949317
9318+ get_func_opts (wfunc -> winformat , wfunc -> winformatopts , context );
9319+
92959320 if (wfunc -> aggfilter != NULL )
92969321 {
92979322 appendStringInfoString (buf , ") FILTER (WHERE " );
0 commit comments