PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 RECORD. This function
124  * encapsulates the logic for determining the correct rowtype OID to use.
125  *
126  * If allowScalar is true, then for the case where the RTE is a single function
127  * returning a non-composite result type, we produce a normal Var referencing
128  * the function's result directly, instead of the single-column composite
129  * value that the whole-row notation might otherwise suggest.
130  */
131 Var *
133  Index varno,
134  Index varlevelsup,
135  bool allowScalar)
136 {
137  Var *result;
138  Oid toid;
139  Node *fexpr;
140 
141  switch (rte->rtekind)
142  {
143  case RTE_RELATION:
144  /* relation: the rowtype is a named composite type */
145  toid = get_rel_type_id(rte->relid);
146  if (!OidIsValid(toid))
147  elog(ERROR, "could not find type OID for relation %u",
148  rte->relid);
149  result = makeVar(varno,
151  toid,
152  -1,
153  InvalidOid,
154  varlevelsup);
155  break;
156 
157  case RTE_FUNCTION:
158 
159  /*
160  * If there's more than one function, or ordinality is requested,
161  * force a RECORD result, since there's certainly more than one
162  * column involved and it can't be a known named type.
163  */
164  if (rte->funcordinality || list_length(rte->functions) != 1)
165  {
166  /* always produces an anonymous RECORD result */
167  result = makeVar(varno,
169  RECORDOID,
170  -1,
171  InvalidOid,
172  varlevelsup);
173  break;
174  }
175 
176  fexpr = ((RangeTblFunction *) linitial(rte->functions))->funcexpr;
177  toid = exprType(fexpr);
178  if (type_is_rowtype(toid))
179  {
180  /* func returns composite; same as relation case */
181  result = makeVar(varno,
183  toid,
184  -1,
185  InvalidOid,
186  varlevelsup);
187  }
188  else if (allowScalar)
189  {
190  /* func returns scalar; just return its output as-is */
191  result = makeVar(varno,
192  1,
193  toid,
194  -1,
195  exprCollation(fexpr),
196  varlevelsup);
197  }
198  else
199  {
200  /* func returns scalar, but we want a composite result */
201  result = makeVar(varno,
203  RECORDOID,
204  -1,
205  InvalidOid,
206  varlevelsup);
207  }
208  break;
209 
210  default:
211 
212  /*
213  * RTE is a join, subselect, or VALUES. We represent this as a
214  * whole-row Var of RECORD type. (Note that in most cases the Var
215  * will be expanded to a RowExpr during planning, but that is not
216  * our concern here.)
217  */
218  result = makeVar(varno,
220  RECORDOID,
221  -1,
222  InvalidOid,
223  varlevelsup);
224  break;
225  }
226 
227  return result;
228 }
229 
230 /*
231  * makeTargetEntry -
232  * creates a TargetEntry node
233  */
234 TargetEntry *
236  AttrNumber resno,
237  char *resname,
238  bool resjunk)
239 {
241 
242  tle->expr = expr;
243  tle->resno = resno;
244  tle->resname = resname;
245 
246  /*
247  * We always set these fields to 0. If the caller wants to change them he
248  * must do so explicitly. Few callers do that, so omitting these
249  * arguments reduces the chance of error.
250  */
251  tle->ressortgroupref = 0;
252  tle->resorigtbl = InvalidOid;
253  tle->resorigcol = 0;
254 
255  tle->resjunk = resjunk;
256 
257  return tle;
258 }
259 
260 /*
261  * flatCopyTargetEntry -
262  * duplicate a TargetEntry, but don't copy substructure
263  *
264  * This is commonly used when we just want to modify the resno or substitute
265  * a new expression.
266  */
267 TargetEntry *
269 {
271 
272  Assert(IsA(src_tle, TargetEntry));
273  memcpy(tle, src_tle, sizeof(TargetEntry));
274  return tle;
275 }
276 
277 /*
278  * makeFromExpr -
279  * creates a FromExpr node
280  */
281 FromExpr *
282 makeFromExpr(List *fromlist, Node *quals)
283 {
284  FromExpr *f = makeNode(FromExpr);
285 
286  f->fromlist = fromlist;
287  f->quals = quals;
288  return f;
289 }
290 
291 /*
292  * makeConst -
293  * creates a Const node
294  */
295 Const *
296 makeConst(Oid consttype,
297  int32 consttypmod,
298  Oid constcollid,
299  int constlen,
300  Datum constvalue,
301  bool constisnull,
302  bool constbyval)
303 {
304  Const *cnst = makeNode(Const);
305 
306  /*
307  * If it's a varlena value, force it to be in non-expanded (non-toasted)
308  * format; this avoids any possible dependency on external values and
309  * improves consistency of representation, which is important for equal().
310  */
311  if (!constisnull && constlen == -1)
312  constvalue = PointerGetDatum(PG_DETOAST_DATUM(constvalue));
313 
314  cnst->consttype = consttype;
315  cnst->consttypmod = consttypmod;
316  cnst->constcollid = constcollid;
317  cnst->constlen = constlen;
318  cnst->constvalue = constvalue;
319  cnst->constisnull = constisnull;
320  cnst->constbyval = constbyval;
321  cnst->location = -1; /* "unknown" */
322 
323  return cnst;
324 }
325 
326 /*
327  * makeNullConst -
328  * creates a Const node representing a NULL of the specified type/typmod
329  *
330  * This is a convenience routine that just saves a lookup of the type's
331  * storage properties.
332  */
333 Const *
334 makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
335 {
336  int16 typLen;
337  bool typByVal;
338 
339  get_typlenbyval(consttype, &typLen, &typByVal);
340  return makeConst(consttype,
341  consttypmod,
342  constcollid,
343  (int) typLen,
344  (Datum) 0,
345  true,
346  typByVal);
347 }
348 
349 /*
350  * makeBoolConst -
351  * creates a Const node representing a boolean value (can be NULL too)
352  */
353 Node *
354 makeBoolConst(bool value, bool isnull)
355 {
356  /* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
357  return (Node *) makeConst(BOOLOID, -1, InvalidOid, 1,
358  BoolGetDatum(value), isnull, true);
359 }
360 
361 /*
362  * makeBoolExpr -
363  * creates a BoolExpr node
364  */
365 Expr *
367 {
368  BoolExpr *b = makeNode(BoolExpr);
369 
370  b->boolop = boolop;
371  b->args = args;
372  b->location = location;
373 
374  return (Expr *) b;
375 }
376 
377 /*
378  * makeAlias -
379  * creates an Alias node
380  *
381  * NOTE: the given name is copied, but the colnames list (if any) isn't.
382  */
383 Alias *
384 makeAlias(const char *aliasname, List *colnames)
385 {
386  Alias *a = makeNode(Alias);
387 
388  a->aliasname = pstrdup(aliasname);
389  a->colnames = colnames;
390 
391  return a;
392 }
393 
394 /*
395  * makeRelabelType -
396  * creates a RelabelType node
397  */
398 RelabelType *
399 makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid,
400  CoercionForm rformat)
401 {
403 
404  r->arg = arg;
405  r->resulttype = rtype;
406  r->resulttypmod = rtypmod;
407  r->resultcollid = rcollid;
408  r->relabelformat = rformat;
409  r->location = -1;
410 
411  return r;
412 }
413 
414 /*
415  * makeRangeVar -
416  * creates a RangeVar node (rather oversimplified case)
417  */
418 RangeVar *
419 makeRangeVar(char *schemaname, char *relname, int location)
420 {
421  RangeVar *r = makeNode(RangeVar);
422 
423  r->catalogname = NULL;
424  r->schemaname = schemaname;
425  r->relname = relname;
426  r->inh = true;
428  r->alias = NULL;
429  r->location = location;
430 
431  return r;
432 }
433 
434 /*
435  * makeTypeName -
436  * build a TypeName node for an unqualified name.
437  *
438  * typmod is defaulted, but can be changed later by caller.
439  */
440 TypeName *
441 makeTypeName(char *typnam)
442 {
444 }
445 
446 /*
447  * makeTypeNameFromNameList -
448  * build a TypeName node for a String list representing a qualified name.
449  *
450  * typmod is defaulted, but can be changed later by caller.
451  */
452 TypeName *
454 {
455  TypeName *n = makeNode(TypeName);
456 
457  n->names = names;
458  n->typmods = NIL;
459  n->typemod = -1;
460  n->location = -1;
461  return n;
462 }
463 
464 /*
465  * makeTypeNameFromOid -
466  * build a TypeName node to represent a type already known by OID/typmod.
467  */
468 TypeName *
469 makeTypeNameFromOid(Oid typeOid, int32 typmod)
470 {
471  TypeName *n = makeNode(TypeName);
472 
473  n->typeOid = typeOid;
474  n->typemod = typmod;
475  n->location = -1;
476  return n;
477 }
478 
479 /*
480  * makeColumnDef -
481  * build a ColumnDef node to represent a simple column definition.
482  *
483  * Type and collation are specified by OID.
484  * Other properties are all basic to start with.
485  */
486 ColumnDef *
487 makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
488 {
490 
491  n->colname = pstrdup(colname);
492  n->typeName = makeTypeNameFromOid(typeOid, typmod);
493  n->inhcount = 0;
494  n->is_local = true;
495  n->is_not_null = false;
496  n->is_from_type = false;
497  n->storage = 0;
498  n->raw_default = NULL;
499  n->cooked_default = NULL;
500  n->collClause = NULL;
501  n->collOid = collOid;
502  n->constraints = NIL;
503  n->fdwoptions = NIL;
504  n->location = -1;
505 
506  return n;
507 }
508 
509 /*
510  * makeFuncExpr -
511  * build an expression tree representing a function call.
512  *
513  * The argument expressions must have been transformed already.
514  */
515 FuncExpr *
516 makeFuncExpr(Oid funcid, Oid rettype, List *args,
517  Oid funccollid, Oid inputcollid, CoercionForm fformat)
518 {
519  FuncExpr *funcexpr;
520 
521  funcexpr = makeNode(FuncExpr);
522  funcexpr->funcid = funcid;
523  funcexpr->funcresulttype = rettype;
524  funcexpr->funcretset = false; /* only allowed case here */
525  funcexpr->funcvariadic = false; /* only allowed case here */
526  funcexpr->funcformat = fformat;
527  funcexpr->funccollid = funccollid;
528  funcexpr->inputcollid = inputcollid;
529  funcexpr->args = args;
530  funcexpr->location = -1;
531 
532  return funcexpr;
533 }
534 
535 /*
536  * makeDefElem -
537  * build a DefElem node
538  *
539  * This is sufficient for the "typical" case with an unqualified option name
540  * and no special action.
541  */
542 DefElem *
543 makeDefElem(char *name, Node *arg, int location)
544 {
545  DefElem *res = makeNode(DefElem);
546 
547  res->defnamespace = NULL;
548  res->defname = name;
549  res->arg = arg;
550  res->defaction = DEFELEM_UNSPEC;
551  res->location = location;
552 
553  return res;
554 }
555 
556 /*
557  * makeDefElemExtended -
558  * build a DefElem node with all fields available to be specified
559  */
560 DefElem *
561 makeDefElemExtended(char *nameSpace, char *name, Node *arg,
562  DefElemAction defaction, int location)
563 {
564  DefElem *res = makeNode(DefElem);
565 
566  res->defnamespace = nameSpace;
567  res->defname = name;
568  res->arg = arg;
569  res->defaction = defaction;
570  res->location = location;
571 
572  return res;
573 }
574 
575 /*
576  * makeFuncCall -
577  *
578  * Initialize a FuncCall struct with the information every caller must
579  * supply. Any non-default parameters have to be inserted by the caller.
580  */
581 FuncCall *
582 makeFuncCall(List *name, List *args, int location)
583 {
584  FuncCall *n = makeNode(FuncCall);
585 
586  n->funcname = name;
587  n->args = args;
588  n->agg_order = NIL;
589  n->agg_filter = NULL;
590  n->agg_within_group = false;
591  n->agg_star = false;
592  n->agg_distinct = false;
593  n->func_variadic = false;
594  n->over = NULL;
595  n->location = location;
596  return n;
597 }
598 
599 /*
600  * makeGroupingSet
601  *
602  */
603 GroupingSet *
604 makeGroupingSet(GroupingSetKind kind, List *content, int location)
605 {
607 
608  n->kind = kind;
609  n->content = content;
610  n->location = location;
611  return n;
612 }
Datum constvalue
Definition: primnodes.h:174
Value * makeString(char *str)
Definition: value.c:53
signed short int16
Definition: c.h:252
DefElem * makeDefElemExtended(char *nameSpace, char *name, Node *arg, DefElemAction defaction, int location)
Definition: makefuncs.c:561
Oid funcresulttype
Definition: primnodes.h:427
#define NIL
Definition: pg_list.h:69
static struct @76 value
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:420
FromExpr * makeFromExpr(List *fromlist, Node *quals)
Definition: makefuncs.c:282
Oid typeOid
Definition: parsenodes.h:201
#define IsA(nodeptr, _type_)
Definition: nodes.h:559
Index varlevelsup
Definition: primnodes.h:151
List * content
Definition: parsenodes.h:1172
List * names
Definition: parsenodes.h:200
A_Expr_Kind kind
Definition: parsenodes.h:266
bool constbyval
Definition: primnodes.h:177
char storage
Definition: parsenodes.h:604
List * args
Definition: primnodes.h:434
List * colnames
Definition: primnodes.h:42
bool is_local
Definition: parsenodes.h:601
int32 exprTypmod(const Node *expr)
Definition: nodeFuncs.c:273
#define PointerGetDatum(X)
Definition: postgres.h:564
Oid funccollid
Definition: primnodes.h:432
List * constraints
Definition: parsenodes.h:609
Node * agg_filter
Definition: parsenodes.h:344
char * pstrdup(const char *in)
Definition: mcxt.c:1165
Var * makeVarFromTargetEntry(Index varno, TargetEntry *tle)
Definition: makefuncs.c:104
char * defnamespace
Definition: parsenodes.h:674
Expr * arg
Definition: primnodes.h:767
DefElemAction defaction
Definition: parsenodes.h:677
Definition: nodes.h:508
Var * makeWholeRowVar(RangeTblEntry *rte, Index varno, Index varlevelsup, bool allowScalar)
Definition: makefuncs.c:132
Oid resorigtbl
Definition: primnodes.h:1335
AttrNumber varattno
Definition: primnodes.h:146
bool funcretset
Definition: primnodes.h:428
List * fromlist
Definition: primnodes.h:1433
bool is_not_null
Definition: parsenodes.h:602
bool funcordinality
Definition: parsenodes.h:932
int location
Definition: parsenodes.h:350
unsigned int Oid
Definition: postgres_ext.h:31
char * resname
Definition: primnodes.h:1332
A_Expr * makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location)
Definition: makefuncs.c:49
Definition: primnodes.h:141
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Definition: makefuncs.c:296
#define OidIsValid(objectId)
Definition: c.h:533
DefElem * makeDefElem(char *name, Node *arg, int location)
Definition: makefuncs.c:543
List * agg_order
Definition: parsenodes.h:343
Node * quals
Definition: primnodes.h:1434
int location
Definition: primnodes.h:541
signed int int32
Definition: c.h:253
Expr * makeBoolExpr(BoolExprType boolop, List *args, int location)
Definition: makefuncs.c:366
Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
Definition: makefuncs.c:334
char * schemaname
Definition: primnodes.h:66
#define RELPERSISTENCE_PERMANENT
Definition: pg_class.h:170
GroupingSetKind kind
Definition: parsenodes.h:1171
#define list_make1(x1)
Definition: pg_list.h:133
int location
Definition: primnodes.h:72
int constlen
Definition: primnodes.h:173
Node * cooked_default
Definition: parsenodes.h:606
Alias * makeAlias(const char *aliasname, List *colnames)
Definition: makefuncs.c:384
char * relname
Definition: primnodes.h:67
Oid consttype
Definition: primnodes.h:170
CoercionForm funcformat
Definition: primnodes.h:431
Index varnoold
Definition: primnodes.h:154
bool resjunk
Definition: primnodes.h:1337
#define linitial(l)
Definition: pg_list.h:110
Oid funcid
Definition: primnodes.h:426
#define ERROR
Definition: elog.h:43
struct WindowDef * over
Definition: parsenodes.h:349
Oid vartype
Definition: primnodes.h:148
BoolExprType boolop
Definition: primnodes.h:539
Node * makeBoolConst(bool value, bool isnull)
Definition: makefuncs.c:354
Oid constcollid
Definition: primnodes.h:172
int location
Definition: primnodes.h:156
RelabelType * makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat)
Definition: makefuncs.c:399
Oid collOid
Definition: parsenodes.h:608
int location
Definition: parsenodes.h:678
List * fdwoptions
Definition: parsenodes.h:610
Node * rexpr
Definition: parsenodes.h:269
AttrNumber resno
Definition: primnodes.h:1331
int location
Definition: parsenodes.h:270
#define RECORDOID
Definition: pg_type.h:668
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:611
TargetEntry * flatCopyTargetEntry(TargetEntry *src_tle)
Definition: makefuncs.c:268
bool type_is_rowtype(Oid typid)
Definition: lsyscache.c:2372
Node * lexpr
Definition: parsenodes.h:268
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
Definition: makefuncs.c:235
Var * makeVar(Index varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Definition: makefuncs.c:67
bool inh
Definition: primnodes.h:68
Node * arg
Definition: parsenodes.h:676
Node * raw_default
Definition: parsenodes.h:605
Index varno
Definition: primnodes.h:144
bool func_variadic
Definition: parsenodes.h:348
FuncCall * makeFuncCall(List *name, List *args, int location)
Definition: makefuncs.c:582
int location
Definition: primnodes.h:181
uintptr_t Datum
Definition: postgres.h:374
List * typmods
Definition: parsenodes.h:204
Oid get_rel_type_id(Oid relid)
Definition: lsyscache.c:1745
Oid resulttype
Definition: primnodes.h:768
unsigned int Index
Definition: c.h:361
#define BoolGetDatum(X)
Definition: postgres.h:410
TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod)
Definition: makefuncs.c:469
Oid resultcollid
Definition: primnodes.h:770
#define InvalidOid
Definition: postgres_ext.h:36
TypeName * makeTypeName(char *typnam)
Definition: makefuncs.c:441
bool is_from_type
Definition: parsenodes.h:603
#define makeNode(_type_)
Definition: nodes.h:556
Oid inputcollid
Definition: primnodes.h:433
#define NULL
Definition: c.h:226
#define Assert(condition)
Definition: c.h:670
char * aliasname
Definition: primnodes.h:41
List * functions
Definition: parsenodes.h:931
Expr * expr
Definition: primnodes.h:1330
int location
Definition: parsenodes.h:207
A_Expr_Kind
Definition: parsenodes.h:243
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:42
List * args
Definition: parsenodes.h:342
static int list_length(const List *l)
Definition: pg_list.h:89
Oid exprCollation(const Node *expr)
Definition: nodeFuncs.c:745
void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval)
Definition: lsyscache.c:1969
int32 typemod
Definition: parsenodes.h:205
TypeName * typeName
Definition: parsenodes.h:599
CollateClause * collClause
Definition: parsenodes.h:607
#define BOOLOID
Definition: pg_type.h:288
List * args
Definition: primnodes.h:540
List * name
Definition: parsenodes.h:267
const char * name
Definition: encode.c:521
#define InvalidAttrNumber
Definition: attnum.h:23
int32 consttypmod
Definition: primnodes.h:171
char relpersistence
Definition: primnodes.h:70
AttrNumber varoattno
Definition: primnodes.h:155
RTEKind rtekind
Definition: parsenodes.h:882
AttrNumber resorigcol
Definition: primnodes.h:1336
GroupingSet * makeGroupingSet(GroupingSetKind kind, List *content, int location)
Definition: makefuncs.c:604
int inhcount
Definition: parsenodes.h:600
TypeName * makeTypeNameFromNameList(List *names)
Definition: makefuncs.c:453
Oid varcollid
Definition: primnodes.h:150
Index ressortgroupref
Definition: primnodes.h:1333
DefElemAction
Definition: parsenodes.h:663
void * arg
Alias * alias
Definition: primnodes.h:71
#define PG_DETOAST_DATUM(datum)
Definition: fmgr.h:196
GroupingSetKind
Definition: parsenodes.h:1159
char * defname
Definition: parsenodes.h:675
char * colname
Definition: parsenodes.h:598
int32 resulttypmod
Definition: primnodes.h:769
int location
Definition: primnodes.h:435
#define elog
Definition: elog.h:219
List * funcname
Definition: parsenodes.h:341
bool agg_within_group
Definition: parsenodes.h:345
CoercionForm relabelformat
Definition: primnodes.h:771
bool agg_distinct
Definition: parsenodes.h:347
CoercionForm
Definition: primnodes.h:413
bool agg_star
Definition: parsenodes.h:346
Definition: pg_list.h:45
int16 AttrNumber
Definition: attnum.h:21
int location
Definition: primnodes.h:772
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition: makefuncs.c:419
char * catalogname
Definition: primnodes.h:65
bool constisnull
Definition: primnodes.h:175
bool funcvariadic
Definition: primnodes.h:429
ColumnDef * makeColumnDef(const char *colname, Oid typeOid, int32 typmod, Oid collOid)
Definition: makefuncs.c:487
FuncExpr * makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
Definition: makefuncs.c:516
BoolExprType
Definition: primnodes.h:531
int32 vartypmod
Definition: primnodes.h:149