]> granicus.if.org Git - postgresql/blob - src/include/parser/parse_agg.h
938d408bb701a3c1881d893074136de2312a52b7
[postgresql] / src / include / parser / parse_agg.h
1 /*-------------------------------------------------------------------------
2  *
3  * parse_agg.h
4  *        handle aggregates and window functions in parser
5  *
6  * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/parser/parse_agg.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PARSE_AGG_H
14 #define PARSE_AGG_H
15
16 #include "parser/parse_node.h"
17
18 extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
19                                            List *args, List *aggorder,
20                                            bool agg_distinct);
21 extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
22                                                 WindowDef *windef);
23
24 extern void parseCheckAggregates(ParseState *pstate, Query *qry);
25
26 extern int      get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes);
27
28 extern Oid resolve_aggregate_transtype(Oid aggfuncid,
29                                                         Oid aggtranstype,
30                                                         Oid *inputTypes,
31                                                         int numArguments);
32
33 extern void build_aggregate_fnexprs(Oid *agg_input_types,
34                                                 int agg_num_inputs,
35                                                 int agg_num_direct_inputs,
36                                                 bool agg_ordered_set,
37                                                 bool agg_variadic,
38                                                 Oid agg_state_type,
39                                                 Oid agg_result_type,
40                                                 Oid agg_input_collation,
41                                                 Oid transfn_oid,
42                                                 Oid invtransfn_oid,
43                                                 Oid finalfn_oid,
44                                                 Expr **transfnexpr,
45                                                 Expr **invtransfnexpr,
46                                                 Expr **finalfnexpr);
47
48 #endif   /* PARSE_AGG_H */