@@ -8868,6 +8868,16 @@ get_oper_expr(OpExpr *expr, deparse_context *context)
88688868 appendStringInfoChar (buf , ')' );
88698869}
88708870
8871+ static void
8872+ get_func_opts (FuncFormat aggformat , Node * aggformatopts , deparse_context * context )
8873+ {
8874+ switch (aggformat )
8875+ {
8876+ default :
8877+ break ;
8878+ }
8879+ }
8880+
88718881/*
88728882 * get_func_expr - Parse back a FuncExpr node
88738883 */
@@ -8882,6 +8892,7 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
88828892 List * argnames ;
88838893 bool use_variadic ;
88848894 ListCell * l ;
8895+ const char * funcname ;
88858896
88868897 /*
88878898 * If the function call came from an implicit coercion, then just show the
@@ -8936,12 +8947,19 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89368947 nargs ++ ;
89378948 }
89388949
8939- appendStringInfo (buf , "%s(" ,
8940- generate_function_name (funcoid , nargs ,
8941- argnames , argtypes ,
8942- expr -> funcvariadic ,
8943- & use_variadic ,
8944- context -> special_exprkind ));
8950+ switch (expr -> funcformat2 )
8951+ {
8952+ default :
8953+ funcname = generate_function_name (funcoid , nargs ,
8954+ argnames , argtypes ,
8955+ expr -> funcvariadic ,
8956+ & use_variadic ,
8957+ context -> special_exprkind );
8958+ break ;
8959+ }
8960+
8961+ appendStringInfo (buf , "%s(" , funcname );
8962+
89458963 nargs = 0 ;
89468964 foreach (l , expr -> args )
89478965 {
@@ -8951,6 +8969,9 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
89518969 appendStringInfoString (buf , "VARIADIC " );
89528970 get_rule_expr ((Node * ) lfirst (l ), context , true);
89538971 }
8972+
8973+ get_func_opts (expr -> funcformat2 , expr -> funcformatopts , context );
8974+
89548975 appendStringInfoChar (buf , ')' );
89558976}
89568977
@@ -9049,6 +9070,8 @@ get_agg_expr(Aggref *aggref, deparse_context *context,
90499070 }
90509071 }
90519072
9073+ get_func_opts (aggref -> aggformat , aggref -> aggformatopts , context );
9074+
90529075 if (aggref -> aggfilter != NULL )
90539076 {
90549077 appendStringInfoString (buf , ") FILTER (WHERE " );
@@ -9115,6 +9138,8 @@ get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
91159138 else
91169139 get_rule_expr ((Node * ) wfunc -> args , context , true);
91179140
9141+ get_func_opts (wfunc -> winformat , wfunc -> winformatopts , context );
9142+
91189143 if (wfunc -> aggfilter != NULL )
91199144 {
91209145 appendStringInfoString (buf , ") FILTER (WHERE " );
0 commit comments