PostgreSQL Source Code  git master
makefuncs.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * makefuncs.h
4  * prototypes for the creator functions of various nodes
5  *
6  *
7  * Portions Copyright (c) 1996-2024, 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 
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 
72 extern TypeName *makeTypeName(char *typnam);
73 extern TypeName *makeTypeNameFromNameList(List *names);
74 extern TypeName *makeTypeNameFromOid(Oid typeOid, int32 typmod);
75 
76 extern ColumnDef *makeColumnDef(const char *colname,
77  Oid typeOid, int32 typmod, Oid collOid);
78 
79 extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype, List *args,
80  Oid funccollid, Oid inputcollid, CoercionForm fformat);
81 
83  CoercionForm funcformat, int location);
84 
85 extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
86  Expr *leftop, Expr *rightop,
87  Oid opcollid, Oid inputcollid);
88 
89 extern Expr *make_andclause(List *andclauses);
90 extern Expr *make_orclause(List *orclauses);
91 extern Expr *make_notclause(Expr *notclause);
92 
93 extern Node *make_and_qual(Node *qual1, Node *qual2);
94 extern Expr *make_ands_explicit(List *andclauses);
95 extern List *make_ands_implicit(Expr *clause);
96 
97 extern IndexInfo *makeIndexInfo(int numattrs, int numkeyattrs, Oid amoid,
98  List *expressions, List *predicates,
99  bool unique, bool nulls_not_distinct,
100  bool isready, bool concurrent,
101  bool summarizing, bool withoutoverlaps);
102 
103 extern Node *makeStringConst(char *str, int location);
104 extern DefElem *makeDefElem(char *name, Node *arg, int location);
105 extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg,
106  DefElemAction defaction, int location);
107 
108 extern GroupingSet *makeGroupingSet(GroupingSetKind kind, List *content, int location);
109 
110 extern VacuumRelation *makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols);
111 
113  int location);
114 extern JsonValueExpr *makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr,
115  JsonFormat *format);
116 extern Node *makeJsonKeyValue(Node *key, Node *value);
118  JsonValueType item_type, bool unique_keys,
119  int location);
121  int location);
122 extern JsonTablePath *makeJsonTablePath(Const *pathvalue, char *pathname);
123 extern JsonTablePathSpec *makeJsonTablePathSpec(char *string, char *name,
124  int string_location,
125  int name_location);
126 
127 #endif /* MAKEFUNC_H */
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:418
int16 AttrNumber
Definition: attnum.h:21
signed int int32
Definition: c.h:497
unsigned int Index
Definition: c.h:617
const char * str
static struct @157 value
Expr * make_opclause(Oid opno, Oid opresulttype, bool opretset, Expr *leftop, Expr *rightop, Oid opcollid, Oid inputcollid)
Definition: makefuncs.c:628
JsonTablePathSpec * makeJsonTablePathSpec(char *string, char *name, int string_location, int name_location)
Definition: makefuncs.c:932
JsonTablePath * makeJsonTablePath(Const *pathvalue, char *pathname)
Definition: makefuncs.c:953
Alias * makeAlias(const char *aliasname, List *colnames)
Definition: makefuncs.c:389
Var * makeWholeRowVar(RangeTblEntry *rte, int varno, Index varlevelsup, bool allowScalar)
Definition: makefuncs.c:135
FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
Definition: makefuncs.c:521
TypeName * makeTypeName(char *typnam)
Definition: makefuncs.c:446
RelabelType * makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat)
Definition: makefuncs.c:404
JsonBehavior * makeJsonBehavior(JsonBehaviorType btype, Node *expr, int location)
Definition: makefuncs.c:882
Var * makeVarFromTargetEntry(int varno, TargetEntry *tle)
Definition: makefuncs.c:105
Node * makeJsonKeyValue(Node *key, Node *value)
Definition: makefuncs.c:898
GroupingSet * makeGroupingSet(GroupingSetKind kind, List *content, int location)
Definition: makefuncs.c:819
Expr * make_notclause(Expr *notclause)
Definition: makefuncs.c:686
List * make_ands_implicit(Expr *clause)
Definition: makefuncs.c:737
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
Definition: makefuncs.c:240
TypeName * makeTypeNameFromNameList(List *names)
Definition: makefuncs.c:458
Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
Definition: makefuncs.c:339
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Definition: makefuncs.c:301
Node * makeStringConst(char *str, int location)
Definition: makefuncs.c:545
VacuumRelation * makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
Definition: makefuncs.c:834
Node * make_and_qual(Node *qual1, Node *qual2)
Definition: makefuncs.c:707
Expr * make_andclause(List *andclauses)
Definition: makefuncs.c:654
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition: makefuncs.c:424
FromExpr * makeFromExpr(List *fromlist, Node *quals)
Definition: makefuncs.c:287
DefElem * makeDefElem(char *name, Node *arg, int location)
Definition: makefuncs.c:564
ColumnDef * makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
Definition: makefuncs.c:492
Var * makeVar(int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Definition: makefuncs.c:66
Expr * make_ands_explicit(List *andclauses)
Definition: makefuncs.c:726
TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod)
Definition: makefuncs.c:474
JsonFormat * makeJsonFormat(JsonFormatType type, JsonEncoding encoding, int location)
Definition: makefuncs.c:849
Expr * makeBoolExpr(BoolExprType boolop, List *args, int location)
Definition: makefuncs.c:371
Node * makeBoolConst(bool value, bool isnull)
Definition: makefuncs.c:359
FuncCall * makeFuncCall(List *name, List *args, CoercionForm funcformat, int location)
Definition: makefuncs.c:603
JsonValueExpr * makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr, JsonFormat *format)
Definition: makefuncs.c:865
TargetEntry * flatCopyTargetEntry(TargetEntry *src_tle)
Definition: makefuncs.c:273
A_Expr * makeA_Expr(A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr, int location)
Definition: makefuncs.c:30
Node * makeJsonIsPredicate(Node *expr, JsonFormat *format, JsonValueType item_type, bool unique_keys, int location)
Definition: makefuncs.c:913
Expr * make_orclause(List *orclauses)
Definition: makefuncs.c:670
DefElem * makeDefElemExtended(char *nameSpace, char *name, Node *arg, DefElemAction defaction, int location)
Definition: makefuncs.c:582
A_Expr * makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location)
Definition: makefuncs.c:48
IndexInfo * makeIndexInfo(int numattrs, int numkeyattrs, Oid amoid, List *expressions, List *predicates, bool unique, bool nulls_not_distinct, bool isready, bool concurrent, bool summarizing, bool withoutoverlaps)
Definition: makefuncs.c:761
GroupingSetKind
Definition: parsenodes.h:1497
A_Expr_Kind
Definition: parsenodes.h:314
DefElemAction
Definition: parsenodes.h:806
void * arg
static char format
NameData relname
Definition: pg_class.h:38
int32 encoding
Definition: pg_database.h:41
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
JsonFormatType
Definition: primnodes.h:1637
BoolExprType
Definition: primnodes.h:930
JsonEncoding
Definition: primnodes.h:1625
JsonBehaviorType
Definition: primnodes.h:1760
CoercionForm
Definition: primnodes.h:733
JsonValueType
Definition: primnodes.h:1717
Definition: pg_list.h:54
Definition: nodes.h:129
Definition: primnodes.h:248
const char * type
const char * name