1/*-------------------------------------------------------------------------
2 *
3 * makefuncs.h
4 * prototypes for the creator functions (for primitive nodes)
5 *
6 *
7 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development PGGroup
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/nodes/makefuncs.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#pragma once
15
16#include "nodes/parsenodes.hpp"
17
18extern PGAExpr *makeAExpr(PGAExpr_Kind kind, PGList *name,
19 PGNode *lexpr, PGNode *rexpr, int location);
20
21extern PGAExpr *makeSimpleAExpr(PGAExpr_Kind kind, const char *name,
22 PGNode *lexpr, PGNode *rexpr, int location);
23
24extern PGVar *makeVar(PGIndex varno,
25 PGAttrNumber varattno,
26 PGOid vartype,
27 int32_t vartypmod,
28 PGOid varcollid,
29 PGIndex varlevelsup);
30
31extern PGVar *makeVarFromTargetEntry(PGIndex varno,
32 PGTargetEntry *tle);
33
34extern PGVar *makeWholeRowVar(PGRangeTblEntry *rte,
35 PGIndex varno,
36 PGIndex varlevelsup,
37 bool allowScalar);
38
39extern PGTargetEntry *makeTargetEntry(PGExpr *expr,
40 PGAttrNumber resno,
41 char *resname,
42 bool resjunk);
43
44extern PGTargetEntry *flatCopyTargetEntry(PGTargetEntry *src_tle);
45
46extern PGFromExpr *makeFromExpr(PGList *fromlist, PGNode *quals);
47
48extern PGConst *makeConst(PGOid consttype,
49 int32_t consttypmod,
50 PGOid constcollid,
51 int constlen,
52 PGDatum constvalue,
53 bool constisnull,
54 bool constbyval);
55
56extern PGConst *makeNullConst(PGOid consttype, int32_t consttypmod, PGOid constcollid);
57
58extern PGNode *makeBoolConst(bool value, bool isnull);
59
60extern PGExpr *makeBoolExpr(PGBoolExprType boolop, PGList *args, int location);
61
62extern PGAlias *makeAlias(const char *aliasname, PGList *colnames);
63
64extern PGRelabelType *makeRelabelType(PGExpr *arg, PGOid rtype, int32_t rtypmod,
65 PGOid rcollid, PGCoercionForm rformat);
66
67extern PGRangeVar *makeRangeVar(char *schemaname, char *relname, int location);
68
69extern PGTypeName *makeTypeName(char *typnam);
70extern PGTypeName *makeTypeNameFromNameList(PGList *names);
71extern PGTypeName *makeTypeNameFromOid(PGOid typeOid, int32_t typmod);
72
73extern PGColumnDef *makeColumnDef(const char *colname,
74 PGOid typeOid, int32_t typmod, PGOid collOid);
75
76extern PGFuncExpr *makeFuncExpr(PGOid funcid, PGOid rettype, PGList *args,
77 PGOid funccollid, PGOid inputcollid, PGCoercionForm fformat);
78
79extern PGFuncCall *makeFuncCall(PGList *name, PGList *args, int location);
80
81extern PGDefElem *makeDefElem(const char *name, PGNode *arg, int location);
82extern PGDefElem *makeDefElemExtended(const char *nameSpace, const char *name, PGNode *arg,
83 PGDefElemAction defaction, int location);
84
85extern PGGroupingSet *makeGroupingSet(GroupingSetKind kind, PGList *content, int location);
86