PostgreSQL Source Code  git master
makefuncs.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * makefuncs.c
4  * creator functions for primitive nodes. The functions here are for
5  * the most frequently created nodes.
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  *
11  * IDENTIFICATION
12  * src/backend/nodes/makefuncs.c
13  *
14  *-------------------------------------------------------------------------
15  */
16 #include "postgres.h"
17 
18 #include "catalog/pg_class.h"
19 #include "catalog/pg_type.h"
20 #include "fmgr.h"
21 #include "nodes/makefuncs.h"
22 #include "nodes/nodeFuncs.h"
23 #include "utils/lsyscache.h"
24 
25 
26 /*
27  * makeA_Expr -
28  * makes an A_Expr node
29  */
30 A_Expr *
32  Node *lexpr, Node *rexpr, int location)
33 {
34  A_Expr *a = makeNode(A_Expr);
35 
36  a->kind = kind;
37  a->name = name;
38  a->lexpr = lexpr;
39  a->rexpr = rexpr;
40  a->location = location;
41  return a;
42 }
43 
44 /*
45  * makeSimpleA_Expr -
46  * As above, given a simple (unqualified) operator name
47  */
48 A_Expr *
50  Node *lexpr, Node *rexpr, int location)
51 {
52  A_Expr *a = makeNode(A_Expr);
53 
54  a->kind = kind;
55  a->name = list_make1(makeString((char *) name));
56  a->lexpr = lexpr;
57  a->rexpr = rexpr;
58  a->location = location;
59  return a;
60 }
61 
62 /*
63  * makeVar -
64  * creates a Var node
65  */
66 Var *
67 makeVar(Index varno,
68  AttrNumber varattno,
69  Oid vartype,
70  int32 vartypmod,
71  Oid varcollid,
72  Index varlevelsup)
73 {
74  Var *var = makeNode(Var);
75 
76  var->varno = varno;
77  var->varattno = varattno;
78  var->vartype = vartype;
79  var->vartypmod = vartypmod;
80  var->varcollid = varcollid;
81  var->varlevelsup = varlevelsup;
82 
83  /*
84  * Since few if any routines ever create Var nodes with varnoold/varoattno
85  * different from varno/varattno, we don't provide separate arguments for
86  * them, but just initialize them to the given varno/varattno. This
87  * reduces code clutter and chance of error for most callers.
88  */
89  var->varnoold = varno;
90  var->varoattno = varattno;
91 
92  /* Likewise, we just set location to "unknown" here */
93  var->location = -1;
94 
95  return var;
96 }
97 
98 /*
99  * makeVarFromTargetEntry -
100  * convenience function to create a same-level Var node from a
101  * TargetEntry
102  */
103 Var *
105  TargetEntry *tle)
106 {
107  return makeVar(varno,
108  tle->resno,
109  exprType((Node *) tle->expr),
110  exprTypmod((Node *) tle->expr),
111  exprCollation((Node *) tle->expr),
112  0);
113 }
114 
115 /*
116  * makeWholeRowVar -
117  * creates a Var node representing a whole row of the specified RTE
118  *
119  * A whole-row reference is a Var with varno set to the correct range
120  * table entry, and varattno == 0 to signal that it references the whole
121  * tuple. (Use of zero here is unclean, since it could easily be confused
122  * with error cases, but it's not worth changing now.) The vartype indicates
123  * a rowtype; either a named composite type, or a domain over a named
124  * composite type (only possible if the RTE is a function returning that),
125  * or RECORD. This function encapsulates the logic for determining the
126  * correct rowtype OID to use.
127  *
128  * If allowScalar is true, then for the case where the RTE is a single function
129  * returning a non-composite result type, we produce a normal Var referencing
130  * the function's result directly, instead of the single-column composite
131  * value that the whole-row notation might otherwise suggest.
132  */
133 Var *
135  Index varno,
136  Index varlevelsup,
137  bool allowScalar)
138 {
139  Var *result;
140  Oid toid;
141  Node *fexpr;
142 
143  switch (rte->rtekind)
144  {
145  case RTE_RELATION:
146  /* relation: the rowtype is a named composite type */
147  toid = get_rel_type_id(rte->relid);
148  if (!OidIsValid(toid))
149  elog(ERROR, "could not find type OID for relation %u",
150  rte->relid);
151  result = makeVar(varno,
153  toid,
154  -1,
155  InvalidOid,
156  varlevelsup);
157  break;
158 
159  case RTE_FUNCTION:
160 
161  /*
162  * If there's more than one function, or ordinality is requested,
163  * force a RECORD result, since there's certainly more than one
164  * column involved and it can't be a known named type.
165  */
166  if (rte->funcordinality || list_length(rte->functions) != 1)
167  {
168  /* always produces an anonymous RECORD result */
169  result = makeVar(varno,
171  RECORDOID,
172  -1,
173  InvalidOid,
174  varlevelsup);
175  break;
176  }
177 
178  fexpr = ((RangeTblFunction *) linitial(rte->functions))->funcexpr;
179  toid = exprType(fexpr);
180  if (type_is_rowtype(toid))
181  {
182  /* func returns composite; same as relation case */
183  result = makeVar(varno,
185  toid,
186  -1,
187  InvalidOid,
188  varlevelsup);
189  }
190  else if (allowScalar)
191  {
192  /* func returns scalar; just return its output as-is */
193  result = makeVar(varno,
194  1,
195  toid,
196  -1,
197  exprCollation(fexpr),
198  varlevelsup);
199  }
200  else
201  {
202  /* func returns scalar, but we want a composite result */
203  result = makeVar(varno,
205  RECORDOID,
206  -1,
207  InvalidOid,
208  varlevelsup);
209  }
210  break;
211 
212  default:
213 
214  /*
215  * RTE is a join, subselect, tablefunc, or VALUES. We represent
216  * this as a whole-row Var of RECORD type. (Note that in most
217  * cases the Var will be expanded to a RowExpr during planning,
218  * but that is not our concern here.)
219  */
220  result = makeVar(varno,
222  RECORDOID,
223  -1,
224  InvalidOid,
225  varlevelsup);
226  break;
227  }
228 
229  return result;
230 }
231 
232 /*
233  * makeTargetEntry -
234  * creates a TargetEntry node
235  */
236 TargetEntry *
238  AttrNumber resno,
239  char *resname,
240  bool resjunk)
241 {
243 
244  tle->expr = expr;
245  tle->resno = resno;
246  tle->resname = resname;
247 
248  /*
249  * We always set these fields to 0. If the caller wants to change them he
250  * must do so explicitly. Few callers do that, so omitting these
251  * arguments reduces the chance of error.
252  */
253  tle->ressortgroupref = 0;
254  tle->resorigtbl = InvalidOid;
255  tle->resorigcol = 0;
256 
257  tle->resjunk = resjunk;
258 
259  return tle;
260 }
261 
262 /*
263  * flatCopyTargetEntry -
264  * duplicate a TargetEntry, but don't copy substructure
265  *
266  * This is commonly used when we just want to modify the resno or substitute
267  * a new expression.
268  */
269 TargetEntry *
271 {
273 
274  Assert(IsA(src_tle, TargetEntry));
275  memcpy(tle, src_tle, sizeof(TargetEntry));
276  return tle;
277 }
278 
279 /*
280  * makeFromExpr -
281  * creates a FromExpr node
282  */
283 FromExpr *
284 makeFromExpr(List *fromlist, Node *quals)
285 {
286  FromExpr *f = makeNode(FromExpr);
287 
288  f->fromlist = fromlist;
289  f->quals = quals;
290  return f;
291 }
292 
293 /*
294  * makeConst -
295  * creates a Const node
296  */
297 Const *
298 makeConst(Oid consttype,
299  int32 consttypmod,
300  Oid constcollid,
301  int constlen,
302  Datum constvalue,
303  bool constisnull,
304  bool constbyval)
305 {
306  Const *cnst = makeNode(Const);
307 
308  /*
309  * If it's a varlena value, force it to be in non-expanded (non-toasted)
310  * format; this avoids any possible dependency on external values and
311  * improves consistency of representation, which is important for equal().
312  */
313  if (!constisnull && constlen == -1)
314  constvalue = PointerGetDatum(PG_DETOAST_DATUM(constvalue));
315 
316  cnst->consttype = consttype;
317  cnst->consttypmod = consttypmod;
318  cnst->constcollid = constcollid;
319  cnst->constlen = constlen;
320  cnst->constvalue = constvalue;
321  cnst->constisnull = constisnull;
322  cnst->constbyval = constbyval;
323  cnst->location = -1; /* "unknown" */
324 
325  return cnst;
326 }
327 
328 /*
329  * makeNullConst -
330  * creates a Const node representing a NULL of the specified type/typmod
331  *
332  * This is a convenience routine that just saves a lookup of the type's
333  * storage properties.
334  */
335 Const *
336 makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
337 {
338  int16 typLen;
339  bool typByVal;
340 
341  get_typlenbyval(consttype, &typLen, &typByVal);
342  return makeConst(consttype,
343  consttypmod,
344  constcollid,
345  (int) typLen,
346  (Datum) 0,
347  true,
348  typByVal);
349 }
350 
351 /*
352  * makeBoolConst -
353  * creates a Const node representing a boolean value (can be NULL too)
354  */
355 Node *
356 makeBoolConst(bool value, bool isnull)
357 {
358  /* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
359  return (Node *) makeConst(BOOLOID, -1, InvalidOid, 1,
360  BoolGetDatum(value), isnull, true);
361 }
362 
363 /*
364  * makeBoolExpr -
365  * creates a BoolExpr node
366  */
367 Expr *
369 {
370  BoolExpr *b = makeNode(BoolExpr);
371 
372  b->boolop = boolop;
373  b->args = args;
374  b->location = location;
375 
376  return (Expr *) b;
377 }
378 
379 /*
380  * makeAlias -
381  * creates an Alias node
382  *
383  * NOTE: the given name is copied, but the colnames list (if any) isn't.
384  */
385 Alias *
386 makeAlias(const char *aliasname, List *colnames)
387 {
388  Alias *a = makeNode(Alias);
389 
390  a->aliasname = pstrdup(aliasname);
391  a->colnames = colnames;
392 
393  return a;
394 }
395 
396 /*
397  * makeRelabelType -
398  * creates a RelabelType node
399  */
400 RelabelType *
401 makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid,
402  CoercionForm rformat)
403 {
405 
406  r->arg = arg;
407  r->resulttype = rtype;
408  r->resulttypmod = rtypmod;
409  r->resultcollid = rcollid;
410  r->relabelformat = rformat;
411  r->location = -1;
412 
413  return r;
414 }
415 
416 /*
417  * makeRangeVar -
418  * creates a RangeVar node (rather oversimplified case)
419  */
420 RangeVar *
421 makeRangeVar(char *schemaname, char *relname, int location)
422 {
423  RangeVar *r = makeNode(RangeVar);
424 
425  r->catalogname = NULL;
426  r->schemaname = schemaname;
427  r->relname = relname;
428  r->inh = true;
430  r->alias = NULL;
431  r->location = location;
432 
433  return r;
434 }
435 
436 /*
437  * makeTypeName -
438  * build a TypeName node for an unqualified name.
439  *
440  * typmod is defaulted, but can be changed later by caller.
441  */
442 TypeName *
443 makeTypeName(char *typnam)
444 {
446 }
447 
448 /*
449  * makeTypeNameFromNameList -
450  * build a TypeName node for a String list representing a qualified name.
451  *
452  * typmod is defaulted, but can be changed later by caller.
453  */
454 TypeName *
456 {
457  TypeName *n = makeNode(TypeName);
458 
459  n->names = names;
460  n->typmods = NIL;
461  n->typemod = -1;
462  n->location = -1;
463  return n;
464 }
465 
466 /*
467  * makeTypeNameFromOid -
468  * build a TypeName node to represent a type already known by OID/typmod.
469  */
470 TypeName *
471 makeTypeNameFromOid(Oid typeOid, int32 typmod)
472 {
473  TypeName *n = makeNode(TypeName);
474 
475  n->typeOid = typeOid;
476  n->typemod = typmod;
477  n->location = -1;
478  return n;
479 }
480 
481 /*
482  * makeColumnDef -
483  * build a ColumnDef node to represent a simple column definition.
484  *
485  * Type and collation are specified by OID.
486  * Other properties are all basic to start with.
487  */
488 ColumnDef *
489 makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
490 {
492 
493  n->colname = pstrdup(colname);
494  n->typeName = makeTypeNameFromOid(typeOid, typmod);
495  n->inhcount = 0;
496  n->is_local = true;
497  n->is_not_null = false;
498  n->is_from_type = false;
499  n->is_from_parent = false;
500  n->storage = 0;
501  n->raw_default = NULL;
502  n->cooked_default = NULL;
503  n->collClause = NULL;
504  n->collOid = collOid;
505  n->constraints = NIL;
506  n->fdwoptions = NIL;
507  n->location = -1;
508 
509  return n;
510 }
511 
512 /*
513  * makeFuncExpr -
514  * build an expression tree representing a function call.
515  *
516  * The argument expressions must have been transformed already.
517  */
518 FuncExpr *
519 makeFuncExpr(Oid funcid, Oid rettype, List *args,
520  Oid funccollid, Oid inputcollid, CoercionForm fformat)
521 {
522  FuncExpr *funcexpr;
523 
524  funcexpr = makeNode(FuncExpr);
525  funcexpr->funcid = funcid;
526  funcexpr->funcresulttype = rettype;
527  funcexpr->funcretset = false; /* only allowed case here */
528  funcexpr->funcvariadic = false; /* only allowed case here */
529  funcexpr->funcformat = fformat;
530  funcexpr->funccollid = funccollid;
531  funcexpr->inputcollid = inputcollid;
532  funcexpr->args = args;
533  funcexpr->location = -1;
534 
535  return funcexpr;
536 }
537 
538 /*
539  * makeDefElem -
540  * build a DefElem node
541  *
542  * This is sufficient for the "typical" case with an unqualified option name
543  * and no special action.
544  */
545 DefElem *
546 makeDefElem(char *name, Node *arg, int location)
547 {
548  DefElem *res = makeNode(DefElem);
549 
550  res->defnamespace = NULL;
551  res->defname = name;
552  res->arg = arg;
553  res->defaction = DEFELEM_UNSPEC;
554  res->location = location;
555 
556  return res;
557 }
558 
559 /*
560  * makeDefElemExtended -
561  * build a DefElem node with all fields available to be specified
562  */
563 DefElem *
564 makeDefElemExtended(char *nameSpace, char *name, Node *arg,
565  DefElemAction defaction, int location)
566 {
567  DefElem *res = makeNode(DefElem);
568 
569  res->defnamespace = nameSpace;
570  res->defname = name;
571  res->arg = arg;
572  res->defaction = defaction;
573  res->location = location;
574 
575  return res;
576 }
577 
578 /*
579  * makeFuncCall -
580  *
581  * Initialize a FuncCall struct with the information every caller must
582  * supply. Any non-default parameters have to be inserted by the caller.
583  */
584 FuncCall *
585 makeFuncCall(List *name, List *args, int location)
586 {
587  FuncCall *n = makeNode(FuncCall);
588 
589  n->funcname = name;
590  n->args = args;
591  n->agg_order = NIL;
592  n->agg_filter = NULL;
593  n->agg_within_group = false;
594  n->agg_star = false;
595  n->agg_distinct = false;
596  n->func_variadic = false;
597  n->over = NULL;
598  n->location = location;
599  return n;
600 }
601 
602 /*
603  * makeGroupingSet
604  *
605  */
606 GroupingSet *
607 makeGroupingSet(GroupingSetKind kind, List *content, int location)
608 {
610 
611  n->kind = kind;
612  n->content = content;
613  n->location = location;
614  return n;
615 }
616 
617 /*
618  * makeVacuumRelation -
619  * create a VacuumRelation node
620  */
622 makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
623 {
625 
626  v->relation = relation;
627  v->oid = oid;
628  v->va_cols = va_cols;
629  return v;
630 }
Datum constvalue
Definition: primnodes.h:196
Value * makeString(char *str)
Definition: value.c:53
signed short int16
Definition: c.h:293
DefElem * makeDefElemExtended(char *nameSpace, char *name, Node *arg, DefElemAction defaction, int location)
Definition: makefuncs.c:564
Oid funcresulttype
Definition: primnodes.h:450
#define NIL
Definition: pg_list.h:69
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:420
FromExpr * makeFromExpr(List *fromlist, Node *quals)
Definition: makefuncs.c:284
Oid typeOid
Definition: parsenodes.h:209
#define IsA(nodeptr, _type_)
Definition: nodes.h:563
Index varlevelsup
Definition: primnodes.h:173
List * content
Definition: parsenodes.h:1266
List * names
Definition: parsenodes.h:208
A_Expr_Kind kind
Definition: parsenodes.h:274
bool constbyval
Definition: primnodes.h:199
char storage
Definition: parsenodes.h:646
List * args
Definition: primnodes.h:457
RangeVar * relation
Definition: parsenodes.h:3134
List * colnames
Definition: primnodes.h:43
bool is_local
Definition: parsenodes.h:642
int32 exprTypmod(const Node *expr)
Definition: nodeFuncs.c:276
#define PointerGetDatum(X)
Definition: postgres.h:562
VacuumRelation * makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
Definition: makefuncs.c:622
Oid funccollid
Definition: primnodes.h:455
List * constraints
Definition: parsenodes.h:652
Node * agg_filter
Definition: parsenodes.h:352
char * pstrdup(const char *in)
Definition: mcxt.c:1063
bool is_from_parent
Definition: parsenodes.h:645
Var * makeVarFromTargetEntry(Index varno, TargetEntry *tle)
Definition: makefuncs.c:104
char * defnamespace
Definition: parsenodes.h:718
Expr * arg
Definition: primnodes.h:794
DefElemAction defaction
Definition: parsenodes.h:721
Definition: nodes.h:512
Var * makeWholeRowVar(RangeTblEntry *rte, Index varno, Index varlevelsup, bool allowScalar)
Definition: makefuncs.c:134
Oid resorigtbl
Definition: primnodes.h:1380
AttrNumber varattno
Definition: primnodes.h:168
bool funcretset
Definition: primnodes.h:451
List * fromlist
Definition: primnodes.h:1478
bool is_not_null
Definition: parsenodes.h:643
bool funcordinality
Definition: parsenodes.h:1006
int location
Definition: parsenodes.h:358
unsigned int Oid
Definition: postgres_ext.h:31
char * resname
Definition: primnodes.h:1377
A_Expr * makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location)
Definition: makefuncs.c:49
Definition: primnodes.h:163
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Definition: makefuncs.c:298
#define OidIsValid(objectId)
Definition: c.h:586
DefElem * makeDefElem(char *name, Node *arg, int location)
Definition: makefuncs.c:546
List * agg_order
Definition: parsenodes.h:351
Node * quals
Definition: primnodes.h:1479
int location
Definition: primnodes.h:564
signed int int32
Definition: c.h:294
Expr * makeBoolExpr(BoolExprType boolop, List *args, int location)
Definition: makefuncs.c:368
Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
Definition: makefuncs.c:336
char * schemaname
Definition: primnodes.h:67
#define RELPERSISTENCE_PERMANENT
Definition: pg_class.h:170
GroupingSetKind kind
Definition: parsenodes.h:1265
#define list_make1(x1)
Definition: pg_list.h:139
int location
Definition: primnodes.h:73
int constlen
Definition: primnodes.h:195
Node * cooked_default
Definition: parsenodes.h:648
Alias * makeAlias(const char *aliasname, List *colnames)
Definition: makefuncs.c:386
char * relname
Definition: primnodes.h:68
Oid consttype
Definition: primnodes.h:192
CoercionForm funcformat
Definition: primnodes.h:454
Index varnoold
Definition: primnodes.h:176
bool resjunk
Definition: primnodes.h:1382
#define linitial(l)
Definition: pg_list.h:111
Oid funcid
Definition: primnodes.h:449
#define ERROR
Definition: elog.h:43
struct WindowDef * over
Definition: parsenodes.h:357
Oid vartype
Definition: primnodes.h:170
BoolExprType boolop
Definition: primnodes.h:562
Node * makeBoolConst(bool value, bool isnull)
Definition: makefuncs.c:356
static struct @121 value
Oid constcollid
Definition: primnodes.h:194
int location
Definition: primnodes.h:178
RelabelType * makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat)
Definition: makefuncs.c:401
Oid collOid
Definition: parsenodes.h:651
int location
Definition: parsenodes.h:722
List * fdwoptions
Definition: parsenodes.h:653
Node * rexpr
Definition: parsenodes.h:277
AttrNumber resno
Definition: primnodes.h:1376
int location
Definition: parsenodes.h:278
#define RECORDOID
Definition: pg_type.h:680
A_Expr * makeA_Expr(A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr, int location)
Definition: makefuncs.c:31
int location
Definition: parsenodes.h:654
TargetEntry * flatCopyTargetEntry(TargetEntry *src_tle)
Definition: makefuncs.c:270
bool type_is_rowtype(Oid typid)
Definition: lsyscache.c:2424
Node * lexpr
Definition: parsenodes.h:276
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
Definition: makefuncs.c:237
Var * makeVar(Index varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Definition: makefuncs.c:67
bool inh
Definition: primnodes.h:69
Node * arg
Definition: parsenodes.h:720
Node * raw_default
Definition: parsenodes.h:647
Index varno
Definition: primnodes.h:166
bool func_variadic
Definition: parsenodes.h:356
FuncCall * makeFuncCall(List *name, List *args, int location)
Definition: makefuncs.c:585
int location
Definition: primnodes.h:203
uintptr_t Datum
Definition: postgres.h:372
List * typmods
Definition: parsenodes.h:212
Oid get_rel_type_id(Oid relid)
Definition: lsyscache.c:1796
Oid resulttype
Definition: primnodes.h:795
unsigned int Index
Definition: c.h:423
#define BoolGetDatum(X)
Definition: postgres.h:408
TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod)
Definition: makefuncs.c:471
Oid resultcollid
Definition: primnodes.h:797
#define InvalidOid
Definition: postgres_ext.h:36
TypeName * makeTypeName(char *typnam)
Definition: makefuncs.c:443
bool is_from_type
Definition: parsenodes.h:644
#define makeNode(_type_)
Definition: nodes.h:560
Oid inputcollid
Definition: primnodes.h:456
#define Assert(condition)
Definition: c.h:680
char * aliasname
Definition: primnodes.h:42
List * functions
Definition: parsenodes.h:1005
Expr * expr
Definition: primnodes.h:1375
int location
Definition: parsenodes.h:215
A_Expr_Kind
Definition: parsenodes.h:251
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:42
List * args
Definition: parsenodes.h:350
static int list_length(const List *l)
Definition: pg_list.h:89
Oid exprCollation(const Node *expr)
Definition: nodeFuncs.c:720
void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval)
Definition: lsyscache.c:2020
int32 typemod
Definition: parsenodes.h:213
TypeName * typeName
Definition: parsenodes.h:640
CollateClause * collClause
Definition: parsenodes.h:650
#define BOOLOID
Definition: pg_type.h:288
List * args
Definition: primnodes.h:563
List * name
Definition: parsenodes.h:275
const char * name
Definition: encode.c:521
#define InvalidAttrNumber
Definition: attnum.h:23
int32 consttypmod
Definition: primnodes.h:193
char relpersistence
Definition: primnodes.h:71
AttrNumber varoattno
Definition: primnodes.h:177
RTEKind rtekind
Definition: parsenodes.h:951
AttrNumber resorigcol
Definition: primnodes.h:1381
GroupingSet * makeGroupingSet(GroupingSetKind kind, List *content, int location)
Definition: makefuncs.c:607
int inhcount
Definition: parsenodes.h:641
TypeName * makeTypeNameFromNameList(List *names)
Definition: makefuncs.c:455
Oid varcollid
Definition: primnodes.h:172
Index ressortgroupref
Definition: primnodes.h:1378
DefElemAction
Definition: parsenodes.h:707
void * arg
Alias * alias
Definition: primnodes.h:72
#define PG_DETOAST_DATUM(datum)
Definition: fmgr.h:205
GroupingSetKind
Definition: parsenodes.h:1253
char * defname
Definition: parsenodes.h:719
char * colname
Definition: parsenodes.h:639
int32 resulttypmod
Definition: primnodes.h:796
int location
Definition: primnodes.h:458
#define elog
Definition: elog.h:219
List * funcname
Definition: parsenodes.h:349
bool agg_within_group
Definition: parsenodes.h:353
CoercionForm relabelformat
Definition: primnodes.h:798
bool agg_distinct
Definition: parsenodes.h:355
CoercionForm
Definition: primnodes.h:436
bool agg_star
Definition: parsenodes.h:354
Definition: pg_list.h:45
int16 AttrNumber
Definition: attnum.h:21
int location
Definition: primnodes.h:799
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition: makefuncs.c:421
char * catalogname
Definition: primnodes.h:66
bool constisnull
Definition: primnodes.h:197
bool funcvariadic
Definition: primnodes.h:452
ColumnDef * makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
Definition: makefuncs.c:489
FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
Definition: makefuncs.c:519
BoolExprType
Definition: primnodes.h:554
int32 vartypmod
Definition: primnodes.h:171