@@ -8974,6 +8974,16 @@ get_oper_expr(OpExpr *expr, deparse_context *context)
89748974 appendStringInfoChar (buf , ')' );
89758975}
89768976
8977+ static void
8978+ get_func_opts (FuncFormat aggformat , Node * aggformatopts , deparse_context * context )
8979+ {
8980+ switch (aggformat )
8981+ {
8982+ default :
8983+ break ;
8984+ }
8985+ }
8986+
89778987/*
89788988 * get_func_expr - Parse back a FuncExpr node
89798989 */
@@ -8988,6 +8998,7 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89888998 List * argnames ;
89898999 bool use_variadic ;
89909000 ListCell * l ;
9001+ const char * funcname ;
89919002
89929003 /*
89939004 * If the function call came from an implicit coercion, then just show the
@@ -9042,12 +9053,19 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
90429053 nargs ++ ;
90439054 }
90449055
9045- appendStringInfo (buf , "%s(" ,
9046- generate_function_name (funcoid , nargs ,
9047- argnames , argtypes ,
9048- expr -> funcvariadic ,
9049- & use_variadic ,
9050- context -> special_exprkind ));
9056+ switch (expr -> funcformat2 )
9057+ {
9058+ default :
9059+ funcname = generate_function_name (funcoid , nargs ,
9060+ argnames , argtypes ,
9061+ expr -> funcvariadic ,
9062+ & use_variadic ,
9063+ context -> special_exprkind );
9064+ break ;
9065+ }
9066+
9067+ appendStringInfo (buf , "%s(" , funcname );
9068+
90519069 nargs = 0 ;
90529070 foreach (l , expr -> args )
90539071 {
@@ -9057,6 +9075,9 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
90579075 appendStringInfoString (buf , "VARIADIC " );
90589076 get_rule_expr ((Node * ) lfirst (l ), context , true);
90599077 }
9078+
9079+ get_func_opts (expr -> funcformat2 , expr -> funcformatopts , context );
9080+
90609081 appendStringInfoChar (buf , ')' );
90619082}
90629083
@@ -9155,6 +9176,8 @@ get_agg_expr(Aggref *aggref, deparse_context *context,
91559176 }
91569177 }
91579178
9179+ get_func_opts (aggref -> aggformat , aggref -> aggformatopts , context );
9180+
91589181 if (aggref -> aggfilter != NULL )
91599182 {
91609183 appendStringInfoString (buf , ") FILTER (WHERE " );
@@ -9221,6 +9244,8 @@ get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
92219244 else
92229245 get_rule_expr ((Node * ) wfunc -> args , context , true);
92239246
9247+ get_func_opts (wfunc -> winformat , wfunc -> winformatopts , context );
9248+
92249249 if (wfunc -> aggfilter != NULL )
92259250 {
92269251 appendStringInfoString (buf , ") FILTER (WHERE " );
0 commit comments