| 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 |  | 
|---|
| 18 | extern PGAExpr *makeAExpr(PGAExpr_Kind kind, PGList *name, | 
|---|
| 19 | PGNode *lexpr, PGNode *rexpr, int location); | 
|---|
| 20 |  | 
|---|
| 21 | extern PGAExpr *makeSimpleAExpr(PGAExpr_Kind kind, const char *name, | 
|---|
| 22 | PGNode *lexpr, PGNode *rexpr, int location); | 
|---|
| 23 |  | 
|---|
| 24 | extern PGVar *makeVar(PGIndex varno, | 
|---|
| 25 | PGAttrNumber varattno, | 
|---|
| 26 | PGOid vartype, | 
|---|
| 27 | int32_t vartypmod, | 
|---|
| 28 | PGOid varcollid, | 
|---|
| 29 | PGIndex varlevelsup); | 
|---|
| 30 |  | 
|---|
| 31 | extern PGVar *makeVarFromTargetEntry(PGIndex varno, | 
|---|
| 32 | PGTargetEntry *tle); | 
|---|
| 33 |  | 
|---|
| 34 | extern PGVar *makeWholeRowVar(PGRangeTblEntry *rte, | 
|---|
| 35 | PGIndex varno, | 
|---|
| 36 | PGIndex varlevelsup, | 
|---|
| 37 | bool allowScalar); | 
|---|
| 38 |  | 
|---|
| 39 | extern PGTargetEntry *makeTargetEntry(PGExpr *expr, | 
|---|
| 40 | PGAttrNumber resno, | 
|---|
| 41 | char *resname, | 
|---|
| 42 | bool resjunk); | 
|---|
| 43 |  | 
|---|
| 44 | extern PGTargetEntry *flatCopyTargetEntry(PGTargetEntry *src_tle); | 
|---|
| 45 |  | 
|---|
| 46 | extern PGFromExpr *makeFromExpr(PGList *fromlist, PGNode *quals); | 
|---|
| 47 |  | 
|---|
| 48 | extern PGConst *makeConst(PGOid consttype, | 
|---|
| 49 | int32_t consttypmod, | 
|---|
| 50 | PGOid constcollid, | 
|---|
| 51 | int constlen, | 
|---|
| 52 | PGDatum constvalue, | 
|---|
| 53 | bool constisnull, | 
|---|
| 54 | bool constbyval); | 
|---|
| 55 |  | 
|---|
| 56 | extern PGConst *makeNullConst(PGOid consttype, int32_t consttypmod, PGOid constcollid); | 
|---|
| 57 |  | 
|---|
| 58 | extern PGNode *makeBoolConst(bool value, bool isnull); | 
|---|
| 59 |  | 
|---|
| 60 | extern PGExpr *makeBoolExpr(PGBoolExprType boolop, PGList *args, int location); | 
|---|
| 61 |  | 
|---|
| 62 | extern PGAlias *makeAlias(const char *aliasname, PGList *colnames); | 
|---|
| 63 |  | 
|---|
| 64 | extern PGRelabelType *makeRelabelType(PGExpr *arg, PGOid rtype, int32_t rtypmod, | 
|---|
| 65 | PGOid rcollid, PGCoercionForm rformat); | 
|---|
| 66 |  | 
|---|
| 67 | extern PGRangeVar *makeRangeVar(char *schemaname, char *relname, int location); | 
|---|
| 68 |  | 
|---|
| 69 | extern PGTypeName *makeTypeName(char *typnam); | 
|---|
| 70 | extern PGTypeName *makeTypeNameFromNameList(PGList *names); | 
|---|
| 71 | extern PGTypeName *makeTypeNameFromOid(PGOid typeOid, int32_t typmod); | 
|---|
| 72 |  | 
|---|
| 73 | extern PGColumnDef *makeColumnDef(const char *colname, | 
|---|
| 74 | PGOid typeOid, int32_t typmod, PGOid collOid); | 
|---|
| 75 |  | 
|---|
| 76 | extern PGFuncExpr *makeFuncExpr(PGOid funcid, PGOid rettype, PGList *args, | 
|---|
| 77 | PGOid funccollid, PGOid inputcollid, PGCoercionForm fformat); | 
|---|
| 78 |  | 
|---|
| 79 | extern PGFuncCall *makeFuncCall(PGList *name, PGList *args, int location); | 
|---|
| 80 |  | 
|---|
| 81 | extern PGDefElem *makeDefElem(const char *name, PGNode *arg, int location); | 
|---|
| 82 | extern PGDefElem *makeDefElemExtended(const char *nameSpace, const char *name, PGNode *arg, | 
|---|
| 83 | PGDefElemAction defaction, int location); | 
|---|
| 84 |  | 
|---|
| 85 | extern PGGroupingSet *makeGroupingSet(GroupingSetKind kind, PGList *content, int location); | 
|---|
| 86 |  | 
|---|