@@ -9045,6 +9045,16 @@ get_oper_expr(OpExpr *expr, deparse_context *context)
9045
9045
appendStringInfoChar (buf , ')' );
9046
9046
}
9047
9047
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
+
9048
9058
/*
9049
9059
* get_func_expr - Parse back a FuncExpr node
9050
9060
*/
@@ -9059,6 +9069,7 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
9059
9069
List * argnames ;
9060
9070
bool use_variadic ;
9061
9071
ListCell * l ;
9072
+ const char * funcname ;
9062
9073
9063
9074
/*
9064
9075
* 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,
9113
9124
nargs ++ ;
9114
9125
}
9115
9126
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
+
9122
9140
nargs = 0 ;
9123
9141
foreach (l , expr -> args )
9124
9142
{
@@ -9128,6 +9146,9 @@ get_func_expr(FuncExpr *expr, deparse_context *context,
9128
9146
appendStringInfoString (buf , "VARIADIC " );
9129
9147
get_rule_expr ((Node * ) lfirst (l ), context , true);
9130
9148
}
9149
+
9150
+ get_func_opts (expr -> funcformat2 , expr -> funcformatopts , context );
9151
+
9131
9152
appendStringInfoChar (buf , ')' );
9132
9153
}
9133
9154
@@ -9226,6 +9247,8 @@ get_agg_expr(Aggref *aggref, deparse_context *context,
9226
9247
}
9227
9248
}
9228
9249
9250
+ get_func_opts (aggref -> aggformat , aggref -> aggformatopts , context );
9251
+
9229
9252
if (aggref -> aggfilter != NULL )
9230
9253
{
9231
9254
appendStringInfoString (buf , ") FILTER (WHERE " );
@@ -9292,6 +9315,8 @@ get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
9292
9315
else
9293
9316
get_rule_expr ((Node * ) wfunc -> args , context , true);
9294
9317
9318
+ get_func_opts (wfunc -> winformat , wfunc -> winformatopts , context );
9319
+
9295
9320
if (wfunc -> aggfilter != NULL )
9296
9321
{
9297
9322
appendStringInfoString (buf , ") FILTER (WHERE " );
0 commit comments