| 1 |
/*------------------------------------------------------------------------- |
| 2 |
* |
| 3 |
* makefuncs.h |
| 4 |
* prototypes for the creator functions of various nodes |
| 5 |
* |
| 6 |
* |
| 7 |
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group |
| 8 |
* Portions Copyright (c) 1994, Regents of the University of California |
| 9 |
* |
| 10 |
* src/include/nodes/makefuncs.h |
| 11 |
* |
| 12 |
*------------------------------------------------------------------------- |
| 13 |
*/ |
| 14 |
#ifndef MAKEFUNC_H |
| 15 |
#define MAKEFUNC_H |
| 16 |
|
| 17 |
#include "nodes/execnodes.h" |
| 18 |
#include "nodes/parsenodes.h" |
| 19 |
|
| 20 |
|
| 21 |
extern A_Expr *makeA_Expr(A_Expr_Kind kind, List *name, |
| 22 |
Node *lexpr, Node *rexpr, int location); |
| 23 |
|
| 24 |
extern A_Expr *makeSimpleA_Expr(A_Expr_Kind kind, char *name, |
| 25 |
Node *lexpr, Node *rexpr, int location); |
| 26 |
|
| 27 |
extern Var *makeVar(int varno, |
| 28 |
AttrNumber varattno, |
| 29 |
Oid vartype, |
| 30 |
int32 vartypmod, |
| 31 |
Oid varcollid, |
| 32 |
Index varlevelsup); |
| 33 |
|
| 34 |
extern Var *makeVarFromTargetEntry(int varno, |
| 35 |
TargetEntry *tle); |
| 36 |
|
| 37 |
extern Var *makeWholeRowVar(RangeTblEntry *rte, |
| 38 |
int varno, |
| 39 |
Index varlevelsup, |
| 40 |
bool allowScalar); |
| 41 |
|
| 42 |
extern TargetEntry *makeTargetEntry(Expr *expr, |
| 43 |
AttrNumber resno, |
| 44 |
char *resname, |
| 45 |
bool resjunk); |
| 46 |
|
| 47 |
extern TargetEntry *flatCopyTargetEntry(TargetEntry *src_tle); |
| 48 |
|
| 49 |
extern FromExpr *makeFromExpr(List *fromlist, Node *quals); |
| 50 |
|
| 51 |
extern Const *makeConst(Oid consttype, |
| 52 |
int32 consttypmod, |
| 53 |
Oid constcollid, |
| 54 |
int constlen, |
| 55 |
Datum constvalue, |
| 56 |
bool constisnull, |
| 57 |
bool constbyval); |
| 58 |
|
| 59 |
extern Const *makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid); |
| 60 |
|
| 61 |
extern Node *makeBoolConst(bool value, bool isnull); |
| 62 |
|
| 63 |
extern Expr *makeBoolExpr(BoolExprType boolop, List *args, int location); |
| 64 |
|
| 65 |
extern Alias *makeAlias(const char *aliasname, List *colnames); |
| 66 |
|
| 67 |
extern RelabelType *makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, |
| 68 |
Oid rcollid, CoercionForm rformat); |
| 69 |
|
| 70 |
extern RangeVar *makeRangeVar(char *schemaname, char *relname, int location); |
| 71 |
extern Constraint *makeNotNullConstraint(String *colname); |
| 72 |
|
| 73 |
extern TypeName *makeTypeName(char *typnam); |
| 74 |
extern TypeName *makeTypeNameFromNameList(List *names); |
| 75 |
extern TypeName *makeTypeNameFromOid(Oid typeOid, int32 typmod); |
| 76 |
|
| 77 |
extern ColumnDef *makeColumnDef(const char *colname, |
| 78 |
Oid typeOid, int32 typmod, Oid collOid); |
| 79 |
|
| 80 |
extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype, List *args, |
| 81 |
Oid funccollid, Oid inputcollid, CoercionForm fformat); |
| 82 |
|
| 83 |
extern FuncCall *makeFuncCall(List *name, List *args, |
| 84 |
CoercionForm funcformat, int location); |
| 85 |
|
| 86 |
extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset, |
| 87 |
Expr *leftop, Expr *rightop, |
| 88 |
Oid opcollid, Oid inputcollid); |
| 89 |
|
| 90 |
extern Expr *make_andclause(List *andclauses); |
| 91 |
extern Expr *make_orclause(List *orclauses); |
| 92 |
extern Expr *make_notclause(Expr *notclause); |
| 93 |
|
| 94 |
extern Node *make_and_qual(Node *qual1, Node *qual2); |
| 95 |
extern Expr *make_ands_explicit(List *andclauses); |
| 96 |
extern List *make_ands_implicit(Expr *clause); |
| 97 |
|
| 98 |
extern IndexInfo *makeIndexInfo(int numattrs, int numkeyattrs, Oid amoid, |
| 99 |
List *expressions, List *predicates, |
| 100 |
bool unique, bool nulls_not_distinct, |
| 101 |
bool isready, bool concurrent, |
| 102 |
bool summarizing, bool withoutoverlaps); |
| 103 |
|
| 104 |
extern Node *makeStringConst(char *str, int location); |
| 105 |
extern DefElem *makeDefElem(char *name, Node *arg, int location); |
| 106 |
extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg, |
| 107 |
DefElemAction defaction, int location); |
| 108 |
|
| 109 |
extern GroupingSet *makeGroupingSet(GroupingSetKind kind, List *content, int location); |
| 110 |
|
| 111 |
extern VacuumRelation *makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols); |
| 112 |
|
| 113 |
extern JsonFormat *makeJsonFormat(JsonFormatType type, JsonEncoding encoding, |
| 114 |
int location); |
| 115 |
extern JsonValueExpr *makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr, |
| 116 |
JsonFormat *format); |
| 117 |
extern Node *makeJsonKeyValue(Node *key, Node *value); |
| 118 |
extern Node *makeJsonIsPredicate(Node *expr, JsonFormat *format, |
| 119 |
JsonValueType item_type, bool unique_keys, |
| 120 |
int location); |
| 121 |
extern JsonBehavior *makeJsonBehavior(JsonBehaviorType btype, Node *expr, |
| 122 |
int location); |
| 123 |
extern JsonTablePath *makeJsonTablePath(Const *pathvalue, char *pathname); |
| 124 |
extern JsonTablePathSpec *makeJsonTablePathSpec(char *string, char *name, |
| 125 |
int string_location, |
| 126 |
int name_location); |
| 127 |
|
| 128 |
#endif /* MAKEFUNC_H */ |