PostgreSQL Source Code  git master
parse_agg.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parse_agg.h
4  * handle aggregates and window functions in parser
5  *
6  * Portions Copyright (c) 1996-2017, 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 
23 
24 extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
25  WindowDef *windef);
26 
27 extern void parseCheckAggregates(ParseState *pstate, Query *qry);
28 
29 extern List *expand_grouping_sets(List *groupingSets, int limit);
30 
31 extern int get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes);
32 
33 extern Oid resolve_aggregate_transtype(Oid aggfuncid,
34  Oid aggtranstype,
35  Oid *inputTypes,
36  int numArguments);
37 
38 extern void build_aggregate_transfn_expr(Oid *agg_input_types,
39  int agg_num_inputs,
40  int agg_num_direct_inputs,
41  bool agg_variadic,
42  Oid agg_state_type,
43  Oid agg_input_collation,
44  Oid transfn_oid,
45  Oid invtransfn_oid,
46  Expr **transfnexpr,
47  Expr **invtransfnexpr);
48 
49 extern void build_aggregate_combinefn_expr(Oid agg_state_type,
50  Oid agg_input_collation,
51  Oid combinefn_oid,
52  Expr **combinefnexpr);
53 
54 extern void build_aggregate_serialfn_expr(Oid serialfn_oid,
55  Expr **serialfnexpr);
56 
57 extern void build_aggregate_deserialfn_expr(Oid deserialfn_oid,
58  Expr **deserialfnexpr);
59 
60 extern void build_aggregate_finalfn_expr(Oid *agg_input_types,
61  int num_finalfn_inputs,
62  Oid agg_state_type,
63  Oid agg_result_type,
64  Oid agg_input_collation,
65  Oid finalfn_oid,
66  Expr **finalfnexpr);
67 
68 #endif /* PARSE_AGG_H */
void build_aggregate_deserialfn_expr(Oid deserialfn_oid, Expr **deserialfnexpr)
Definition: parse_agg.c:2006
int get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes)
Definition: parse_agg.c:1812
Definition: nodes.h:512
void transformAggregateCall(ParseState *pstate, Aggref *agg, List *args, List *aggorder, bool agg_distinct)
Definition: parse_agg.c:103
unsigned int Oid
Definition: postgres_ext.h:31
void build_aggregate_combinefn_expr(Oid agg_state_type, Oid agg_input_collation, Oid combinefn_oid, Expr **combinefnexpr)
Definition: parse_agg.c:1954
void build_aggregate_serialfn_expr(Oid serialfn_oid, Expr **serialfnexpr)
Definition: parse_agg.c:1983
Node * transformGroupingFunc(ParseState *pstate, GroupingFunc *g)
Definition: parse_agg.c:248
void build_aggregate_finalfn_expr(Oid *agg_input_types, int num_finalfn_inputs, Oid agg_state_type, Oid agg_result_type, Oid agg_input_collation, Oid finalfn_oid, Expr **finalfnexpr)
Definition: parse_agg.c:2030
void build_aggregate_transfn_expr(Oid *agg_input_types, int agg_num_inputs, int agg_num_direct_inputs, bool agg_variadic, Oid agg_state_type, Oid agg_input_collation, Oid transfn_oid, Oid invtransfn_oid, Expr **transfnexpr, Expr **invtransfnexpr)
Definition: parse_agg.c:1893
Oid resolve_aggregate_transtype(Oid aggfuncid, Oid aggtranstype, Oid *inputTypes, int numArguments)
Definition: parse_agg.c:1838
List * expand_grouping_sets(List *groupingSets, int limit)
Definition: parse_agg.c:1713
void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc, WindowDef *windef)
Definition: parse_agg.c:769
void parseCheckAggregates(ParseState *pstate, Query *qry)
Definition: parse_agg.c:1003
Definition: pg_list.h:45