PostgreSQL Source Code  git master
parse_target.h File Reference
Include dependency graph for parse_target.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ListtransformTargetList (ParseState *pstate, List *targetlist, ParseExprKind exprKind)
 
ListtransformExpressionList (ParseState *pstate, List *exprlist, ParseExprKind exprKind, bool allowDefault)
 
void resolveTargetListUnknowns (ParseState *pstate, List *targetlist)
 
void markTargetListOrigins (ParseState *pstate, List *targetlist)
 
TargetEntrytransformTargetEntry (ParseState *pstate, Node *node, Node *expr, ParseExprKind exprKind, char *colname, bool resjunk)
 
ExprtransformAssignedExpr (ParseState *pstate, Expr *expr, ParseExprKind exprKind, const char *colname, int attrno, List *indirection, int location)
 
void updateTargetListEntry (ParseState *pstate, TargetEntry *tle, char *colname, int attrno, List *indirection, int location)
 
NodetransformAssignmentIndirection (ParseState *pstate, Node *basenode, const char *targetName, bool targetIsSubscripting, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *indirection, ListCell *indirection_cell, Node *rhs, CoercionContext ccontext, int location)
 
ListcheckInsertTargets (ParseState *pstate, List *cols, List **attrnos)
 
TupleDesc expandRecordVariable (ParseState *pstate, Var *var, int levelsup)
 
char * FigureColname (Node *node)
 
char * FigureIndexColname (Node *node)
 

Function Documentation

◆ checkInsertTargets()

List* checkInsertTargets ( ParseState pstate,
List cols,
List **  attrnos 
)

Definition at line 1011 of file parse_target.c.

References attnameAttNum(), bms_add_member(), bms_is_member(), ereport, errcode(), errmsg(), ERROR, i, ResTarget::indirection, InvalidAttrNumber, lappend(), lappend_int(), lfirst, ResTarget::location, makeNode, ResTarget::name, name, NameStr, NIL, ParseState::p_target_relation, parser_errposition(), pstrdup(), RelationData::rd_att, RelationGetNumberOfAttributes, RelationGetRelationName, TupleDescAttr, and ResTarget::val.

Referenced by transformInsertStmt().

1012 {
1013  *attrnos = NIL;
1014 
1015  if (cols == NIL)
1016  {
1017  /*
1018  * Generate default column list for INSERT.
1019  */
1020  int numcol = RelationGetNumberOfAttributes(pstate->p_target_relation);
1021 
1022  int i;
1023 
1024  for (i = 0; i < numcol; i++)
1025  {
1026  ResTarget *col;
1027  Form_pg_attribute attr;
1028 
1029  attr = TupleDescAttr(pstate->p_target_relation->rd_att, i);
1030 
1031  if (attr->attisdropped)
1032  continue;
1033 
1034  col = makeNode(ResTarget);
1035  col->name = pstrdup(NameStr(attr->attname));
1036  col->indirection = NIL;
1037  col->val = NULL;
1038  col->location = -1;
1039  cols = lappend(cols, col);
1040  *attrnos = lappend_int(*attrnos, i + 1);
1041  }
1042  }
1043  else
1044  {
1045  /*
1046  * Do initial validation of user-supplied INSERT column list.
1047  */
1048  Bitmapset *wholecols = NULL;
1049  Bitmapset *partialcols = NULL;
1050  ListCell *tl;
1051 
1052  foreach(tl, cols)
1053  {
1054  ResTarget *col = (ResTarget *) lfirst(tl);
1055  char *name = col->name;
1056  int attrno;
1057 
1058  /* Lookup column name, ereport on failure */
1059  attrno = attnameAttNum(pstate->p_target_relation, name, false);
1060  if (attrno == InvalidAttrNumber)
1061  ereport(ERROR,
1062  (errcode(ERRCODE_UNDEFINED_COLUMN),
1063  errmsg("column \"%s\" of relation \"%s\" does not exist",
1064  name,
1066  parser_errposition(pstate, col->location)));
1067 
1068  /*
1069  * Check for duplicates, but only of whole columns --- we allow
1070  * INSERT INTO foo (col.subcol1, col.subcol2)
1071  */
1072  if (col->indirection == NIL)
1073  {
1074  /* whole column; must not have any other assignment */
1075  if (bms_is_member(attrno, wholecols) ||
1076  bms_is_member(attrno, partialcols))
1077  ereport(ERROR,
1078  (errcode(ERRCODE_DUPLICATE_COLUMN),
1079  errmsg("column \"%s\" specified more than once",
1080  name),
1081  parser_errposition(pstate, col->location)));
1082  wholecols = bms_add_member(wholecols, attrno);
1083  }
1084  else
1085  {
1086  /* partial column; must not have any whole assignment */
1087  if (bms_is_member(attrno, wholecols))
1088  ereport(ERROR,
1089  (errcode(ERRCODE_DUPLICATE_COLUMN),
1090  errmsg("column \"%s\" specified more than once",
1091  name),
1092  parser_errposition(pstate, col->location)));
1093  partialcols = bms_add_member(partialcols, attrno);
1094  }
1095 
1096  *attrnos = lappend_int(*attrnos, attrno);
1097  }
1098  }
1099 
1100  return cols;
1101 }
List * indirection
Definition: parsenodes.h:465
#define NIL
Definition: pg_list.h:65
Node * val
Definition: parsenodes.h:466
char * name
Definition: parsenodes.h:464
#define RelationGetNumberOfAttributes(relation)
Definition: rel.h:483
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
char * pstrdup(const char *in)
Definition: mcxt.c:1299
int errcode(int sqlerrcode)
Definition: elog.c:698
int location
Definition: parsenodes.h:467
#define ERROR
Definition: elog.h:46
#define RelationGetRelationName(relation)
Definition: rel.h:511
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:207
List * lappend_int(List *list, int datum)
Definition: list.c:354
List * lappend(List *list, void *datum)
Definition: list.c:336
TupleDesc rd_att
Definition: rel.h:110
#define ereport(elevel,...)
Definition: elog.h:157
#define makeNode(_type_)
Definition: nodes.h:584
int attnameAttNum(Relation rd, const char *attname, bool sysColOK)
#define lfirst(lc)
Definition: pg_list.h:169
int parser_errposition(ParseState *pstate, int location)
Definition: parse_node.c:111
Bitmapset * bms_add_member(Bitmapset *a, int x)
Definition: bitmapset.c:736
const char * name
Definition: encode.c:561
#define InvalidAttrNumber
Definition: attnum.h:23
int errmsg(const char *fmt,...)
Definition: elog.c:909
Relation p_target_relation
Definition: parse_node.h:192
int i
#define NameStr(name)
Definition: c.h:681
bool bms_is_member(int x, const Bitmapset *a)
Definition: bitmapset.c:427

◆ expandRecordVariable()

TupleDesc expandRecordVariable ( ParseState pstate,
Var var,
int  levelsup 
)

Definition at line 1509 of file parse_target.c.

References Alias::aliasname, Assert, attnum, CreateTemplateTupleDesc(), RangeTblEntry::ctelevelsup, CommonTableExpr::ctequery, elog, RangeTblEntry::eref, ERROR, expandRecordVariable(), expandRTE(), TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), forboth, get_expr_result_tupdesc(), get_tle_by_resno(), GetCTEForRTE(), GetCTETargetList, GetRTEByRangeTablePosn(), i, InvalidAttrNumber, IsA, RangeTblEntry::joinaliasvars, label, lfirst, list_length(), list_nth(), Var::location, MemSet, ParseState::p_rtable, ParseState::parentParseState, TargetEntry::resjunk, Query::rtable, RTE_CTE, RTE_FUNCTION, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, RangeTblEntry::self_reference, strVal, RangeTblEntry::subquery, Query::targetList, TupleDescInitEntry(), TupleDescInitEntryCollation(), Var::varattno, Var::varlevelsup, Var::varno, and Var::vartype.

Referenced by expandRecordVariable(), ExpandRowReference(), and ParseComplexProjection().

1510 {
1511  TupleDesc tupleDesc;
1512  int netlevelsup;
1513  RangeTblEntry *rte;
1515  Node *expr;
1516 
1517  /* Check my caller didn't mess up */
1518  Assert(IsA(var, Var));
1519  Assert(var->vartype == RECORDOID);
1520 
1521  /*
1522  * Note: it's tempting to use GetNSItemByRangeTablePosn here so that we
1523  * can use expandNSItemVars instead of expandRTE; but that does not work
1524  * for some of the recursion cases below, where we have consed up a
1525  * ParseState that lacks p_namespace data.
1526  */
1527  netlevelsup = var->varlevelsup + levelsup;
1528  rte = GetRTEByRangeTablePosn(pstate, var->varno, netlevelsup);
1529  attnum = var->varattno;
1530 
1531  if (attnum == InvalidAttrNumber)
1532  {
1533  /* Whole-row reference to an RTE, so expand the known fields */
1534  List *names,
1535  *vars;
1536  ListCell *lname,
1537  *lvar;
1538  int i;
1539 
1540  expandRTE(rte, var->varno, 0, var->location, false,
1541  &names, &vars);
1542 
1543  tupleDesc = CreateTemplateTupleDesc(list_length(vars));
1544  i = 1;
1545  forboth(lname, names, lvar, vars)
1546  {
1547  char *label = strVal(lfirst(lname));
1548  Node *varnode = (Node *) lfirst(lvar);
1549 
1550  TupleDescInitEntry(tupleDesc, i,
1551  label,
1552  exprType(varnode),
1553  exprTypmod(varnode),
1554  0);
1555  TupleDescInitEntryCollation(tupleDesc, i,
1556  exprCollation(varnode));
1557  i++;
1558  }
1559  Assert(lname == NULL && lvar == NULL); /* lists same length? */
1560 
1561  return tupleDesc;
1562  }
1563 
1564  expr = (Node *) var; /* default if we can't drill down */
1565 
1566  switch (rte->rtekind)
1567  {
1568  case RTE_RELATION:
1569  case RTE_VALUES:
1570  case RTE_NAMEDTUPLESTORE:
1571  case RTE_RESULT:
1572 
1573  /*
1574  * This case should not occur: a column of a table, values list,
1575  * or ENR shouldn't have type RECORD. Fall through and fail (most
1576  * likely) at the bottom.
1577  */
1578  break;
1579  case RTE_SUBQUERY:
1580  {
1581  /* Subselect-in-FROM: examine sub-select's output expr */
1583  attnum);
1584 
1585  if (ste == NULL || ste->resjunk)
1586  elog(ERROR, "subquery %s does not have attribute %d",
1587  rte->eref->aliasname, attnum);
1588  expr = (Node *) ste->expr;
1589  if (IsA(expr, Var))
1590  {
1591  /*
1592  * Recurse into the sub-select to see what its Var refers
1593  * to. We have to build an additional level of ParseState
1594  * to keep in step with varlevelsup in the subselect.
1595  */
1596  ParseState mypstate;
1597 
1598  MemSet(&mypstate, 0, sizeof(mypstate));
1599  mypstate.parentParseState = pstate;
1600  mypstate.p_rtable = rte->subquery->rtable;
1601  /* don't bother filling the rest of the fake pstate */
1602 
1603  return expandRecordVariable(&mypstate, (Var *) expr, 0);
1604  }
1605  /* else fall through to inspect the expression */
1606  }
1607  break;
1608  case RTE_JOIN:
1609  /* Join RTE --- recursively inspect the alias variable */
1610  Assert(attnum > 0 && attnum <= list_length(rte->joinaliasvars));
1611  expr = (Node *) list_nth(rte->joinaliasvars, attnum - 1);
1612  Assert(expr != NULL);
1613  /* We intentionally don't strip implicit coercions here */
1614  if (IsA(expr, Var))
1615  return expandRecordVariable(pstate, (Var *) expr, netlevelsup);
1616  /* else fall through to inspect the expression */
1617  break;
1618  case RTE_FUNCTION:
1619 
1620  /*
1621  * We couldn't get here unless a function is declared with one of
1622  * its result columns as RECORD, which is not allowed.
1623  */
1624  break;
1625  case RTE_TABLEFUNC:
1626 
1627  /*
1628  * Table function cannot have columns with RECORD type.
1629  */
1630  break;
1631  case RTE_CTE:
1632  /* CTE reference: examine subquery's output expr */
1633  if (!rte->self_reference)
1634  {
1635  CommonTableExpr *cte = GetCTEForRTE(pstate, rte, netlevelsup);
1636  TargetEntry *ste;
1637 
1638  ste = get_tle_by_resno(GetCTETargetList(cte), attnum);
1639  if (ste == NULL || ste->resjunk)
1640  elog(ERROR, "CTE %s does not have attribute %d",
1641  rte->eref->aliasname, attnum);
1642  expr = (Node *) ste->expr;
1643  if (IsA(expr, Var))
1644  {
1645  /*
1646  * Recurse into the CTE to see what its Var refers to. We
1647  * have to build an additional level of ParseState to keep
1648  * in step with varlevelsup in the CTE; furthermore it
1649  * could be an outer CTE.
1650  */
1651  ParseState mypstate;
1652  Index levelsup;
1653 
1654  MemSet(&mypstate, 0, sizeof(mypstate));
1655  /* this loop must work, since GetCTEForRTE did */
1656  for (levelsup = 0;
1657  levelsup < rte->ctelevelsup + netlevelsup;
1658  levelsup++)
1659  pstate = pstate->parentParseState;
1660  mypstate.parentParseState = pstate;
1661  mypstate.p_rtable = ((Query *) cte->ctequery)->rtable;
1662  /* don't bother filling the rest of the fake pstate */
1663 
1664  return expandRecordVariable(&mypstate, (Var *) expr, 0);
1665  }
1666  /* else fall through to inspect the expression */
1667  }
1668  break;
1669  }
1670 
1671  /*
1672  * We now have an expression we can't expand any more, so see if
1673  * get_expr_result_tupdesc() can do anything with it.
1674  */
1675  return get_expr_result_tupdesc(expr, false);
1676 }
int varno
Definition: primnodes.h:189
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
List * joinaliasvars
Definition: parsenodes.h:1082
Index varlevelsup
Definition: primnodes.h:196
#define forboth(cell1, list1, cell2, list2)
Definition: pg_list.h:446
TupleDesc CreateTemplateTupleDesc(int natts)
Definition: tupdesc.c:45
int32 exprTypmod(const Node *expr)
Definition: nodeFuncs.c:267
ParseState * parentParseState
Definition: parse_node.h:180
CommonTableExpr * GetCTEForRTE(ParseState *pstate, RangeTblEntry *rte, int rtelevelsup)
Definition: nodes.h:536
#define strVal(v)
Definition: value.h:65
#define MemSet(start, val, len)
Definition: c.h:1008
AttrNumber varattno
Definition: primnodes.h:191
Definition: primnodes.h:186
List * targetList
Definition: parsenodes.h:150
bool resjunk
Definition: primnodes.h:1462
List * rtable
Definition: parsenodes.h:147
#define ERROR
Definition: elog.h:46
TupleDesc get_expr_result_tupdesc(Node *expr, bool noError)
Definition: funcapi.c:440
static void * list_nth(const List *list, int n)
Definition: pg_list.h:278
Oid vartype
Definition: primnodes.h:193
void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid)
Definition: tupdesc.c:754
int location
Definition: primnodes.h:201
TupleDesc expandRecordVariable(ParseState *pstate, Var *var, int levelsup)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
Definition: tupdesc.c:583
void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, int location, bool include_dropped, List **colnames, List **colvars)
bool self_reference
Definition: parsenodes.h:1119
static char * label
RangeTblEntry * GetRTEByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up)
unsigned int Index
Definition: c.h:549
int16 attnum
Definition: pg_attribute.h:83
#define Assert(condition)
Definition: c.h:804
#define lfirst(lc)
Definition: pg_list.h:169
char * aliasname
Definition: primnodes.h:42
Expr * expr
Definition: primnodes.h:1455
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:41
static int list_length(const List *l)
Definition: pg_list.h:149
Oid exprCollation(const Node *expr)
Definition: nodeFuncs.c:759
Index ctelevelsup
Definition: parsenodes.h:1118
#define InvalidAttrNumber
Definition: attnum.h:23
RTEKind rtekind
Definition: parsenodes.h:1007
Query * subquery
Definition: parsenodes.h:1042
#define elog(elevel,...)
Definition: elog.h:232
int i
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
Alias * eref
Definition: parsenodes.h:1153
Definition: regcomp.c:237
Definition: pg_list.h:50
#define GetCTETargetList(cte)
Definition: parsenodes.h:1531
int16 AttrNumber
Definition: attnum.h:21
List * p_rtable
Definition: parse_node.h:182

◆ FigureColname()

char* FigureColname ( Node node)

Definition at line 1689 of file parse_target.c.

References FigureColnameInternal(), and name.

Referenced by transformRangeFunction(), transformTargetEntry(), and transformXmlExpr().

1690 {
1691  char *name = NULL;
1692 
1693  (void) FigureColnameInternal(node, &name);
1694  if (name != NULL)
1695  return name;
1696  /* default result if we can't guess anything */
1697  return "?column?";
1698 }
static int FigureColnameInternal(Node *node, char **name)
const char * name
Definition: encode.c:561

◆ FigureIndexColname()

char* FigureIndexColname ( Node node)

Definition at line 1708 of file parse_target.c.

References FigureColnameInternal(), and name.

Referenced by transformIndexStmt().

1709 {
1710  char *name = NULL;
1711 
1712  (void) FigureColnameInternal(node, &name);
1713  return name;
1714 }
static int FigureColnameInternal(Node *node, char **name)
const char * name
Definition: encode.c:561

◆ markTargetListOrigins()

void markTargetListOrigins ( ParseState pstate,
List targetlist 
)

Definition at line 320 of file parse_target.c.

References TargetEntry::expr, lfirst, and markTargetListOrigin().

Referenced by transformReturningList(), and transformSelectStmt().

321 {
322  ListCell *l;
323 
324  foreach(l, targetlist)
325  {
326  TargetEntry *tle = (TargetEntry *) lfirst(l);
327 
328  markTargetListOrigin(pstate, tle, (Var *) tle->expr, 0);
329  }
330 }
Definition: primnodes.h:186
#define lfirst(lc)
Definition: pg_list.h:169
Expr * expr
Definition: primnodes.h:1455
static void markTargetListOrigin(ParseState *pstate, TargetEntry *tle, Var *var, int levelsup)
Definition: parse_target.c:345

◆ resolveTargetListUnknowns()

void resolveTargetListUnknowns ( ParseState pstate,
List targetlist 
)

Definition at line 290 of file parse_target.c.

References COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, TargetEntry::expr, exprType(), and lfirst.

Referenced by transformReturningList(), transformReturnStmt(), and transformSelectStmt().

291 {
292  ListCell *l;
293 
294  foreach(l, targetlist)
295  {
296  TargetEntry *tle = (TargetEntry *) lfirst(l);
297  Oid restype = exprType((Node *) tle->expr);
298 
299  if (restype == UNKNOWNOID)
300  {
301  tle->expr = (Expr *) coerce_type(pstate, (Node *) tle->expr,
302  restype, TEXTOID, -1,
305  -1);
306  }
307  }
308 }
Node * coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat, int location)
Definition: parse_coerce.c:157
Definition: nodes.h:536
unsigned int Oid
Definition: postgres_ext.h:31
#define lfirst(lc)
Definition: pg_list.h:169
Expr * expr
Definition: primnodes.h:1455
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:41

◆ transformAssignedExpr()

Expr* transformAssignedExpr ( ParseState pstate,
Expr expr,
ParseExprKind  exprKind,
const char *  colname,
int  attrno,
List indirection,
int  location 
)

Definition at line 454 of file parse_target.c.

References Assert, attnumTypeId(), COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, SetToDefault::collation, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_NONE, exprLocation(), exprType(), format_type_be(), IsA, linitial, list_head(), Var::location, makeNullConst(), makeVar(), ParseState::p_expr_kind, ParseState::p_is_insert, ParseNamespaceItem::p_rtindex, ParseState::p_target_nsitem, ParseState::p_target_relation, parser_errposition(), RelationData::rd_att, transformAssignmentIndirection(), TupleDescAttr, SetToDefault::typeId, and SetToDefault::typeMod.

Referenced by transformInsertRow(), and updateTargetListEntry().

461 {
462  Relation rd = pstate->p_target_relation;
463  Oid type_id; /* type of value provided */
464  Oid attrtype; /* type of target column */
465  int32 attrtypmod;
466  Oid attrcollation; /* collation of target column */
467  ParseExprKind sv_expr_kind;
468 
469  /*
470  * Save and restore identity of expression type we're parsing. We must
471  * set p_expr_kind here because we can parse subscripts without going
472  * through transformExpr().
473  */
474  Assert(exprKind != EXPR_KIND_NONE);
475  sv_expr_kind = pstate->p_expr_kind;
476  pstate->p_expr_kind = exprKind;
477 
478  Assert(rd != NULL);
479  if (attrno <= 0)
480  ereport(ERROR,
481  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
482  errmsg("cannot assign to system column \"%s\"",
483  colname),
484  parser_errposition(pstate, location)));
485  attrtype = attnumTypeId(rd, attrno);
486  attrtypmod = TupleDescAttr(rd->rd_att, attrno - 1)->atttypmod;
487  attrcollation = TupleDescAttr(rd->rd_att, attrno - 1)->attcollation;
488 
489  /*
490  * If the expression is a DEFAULT placeholder, insert the attribute's
491  * type/typmod/collation into it so that exprType etc will report the
492  * right things. (We expect that the eventually substituted default
493  * expression will in fact have this type and typmod. The collation
494  * likely doesn't matter, but let's set it correctly anyway.) Also,
495  * reject trying to update a subfield or array element with DEFAULT, since
496  * there can't be any default for portions of a column.
497  */
498  if (expr && IsA(expr, SetToDefault))
499  {
500  SetToDefault *def = (SetToDefault *) expr;
501 
502  def->typeId = attrtype;
503  def->typeMod = attrtypmod;
504  def->collation = attrcollation;
505  if (indirection)
506  {
507  if (IsA(linitial(indirection), A_Indices))
508  ereport(ERROR,
509  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
510  errmsg("cannot set an array element to DEFAULT"),
511  parser_errposition(pstate, location)));
512  else
513  ereport(ERROR,
514  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
515  errmsg("cannot set a subfield to DEFAULT"),
516  parser_errposition(pstate, location)));
517  }
518  }
519 
520  /* Now we can use exprType() safely. */
521  type_id = exprType((Node *) expr);
522 
523  /*
524  * If there is indirection on the target column, prepare an array or
525  * subfield assignment expression. This will generate a new column value
526  * that the source value has been inserted into, which can then be placed
527  * in the new tuple constructed by INSERT or UPDATE.
528  */
529  if (indirection)
530  {
531  Node *colVar;
532 
533  if (pstate->p_is_insert)
534  {
535  /*
536  * The command is INSERT INTO table (col.something) ... so there
537  * is not really a source value to work with. Insert a NULL
538  * constant as the source value.
539  */
540  colVar = (Node *) makeNullConst(attrtype, attrtypmod,
541  attrcollation);
542  }
543  else
544  {
545  /*
546  * Build a Var for the column to be updated.
547  */
548  Var *var;
549 
550  var = makeVar(pstate->p_target_nsitem->p_rtindex, attrno,
551  attrtype, attrtypmod, attrcollation, 0);
552  var->location = location;
553 
554  colVar = (Node *) var;
555  }
556 
557  expr = (Expr *)
559  colVar,
560  colname,
561  false,
562  attrtype,
563  attrtypmod,
564  attrcollation,
565  indirection,
566  list_head(indirection),
567  (Node *) expr,
569  location);
570  }
571  else
572  {
573  /*
574  * For normal non-qualified target column, do type checking and
575  * coercion.
576  */
577  Node *orig_expr = (Node *) expr;
578 
579  expr = (Expr *)
580  coerce_to_target_type(pstate,
581  orig_expr, type_id,
582  attrtype, attrtypmod,
585  -1);
586  if (expr == NULL)
587  ereport(ERROR,
588  (errcode(ERRCODE_DATATYPE_MISMATCH),
589  errmsg("column \"%s\" is of type %s"
590  " but expression is of type %s",
591  colname,
592  format_type_be(attrtype),
593  format_type_be(type_id)),
594  errhint("You will need to rewrite or cast the expression."),
595  parser_errposition(pstate, exprLocation(orig_expr))));
596  }
597 
598  pstate->p_expr_kind = sv_expr_kind;
599 
600  return expr;
601 }
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
int errhint(const char *fmt,...)
Definition: elog.c:1156
int exprLocation(const Node *expr)
Definition: nodeFuncs.c:1250
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
Var * makeVar(int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Definition: makefuncs.c:66
Definition: nodes.h:536
int errcode(int sqlerrcode)
Definition: elog.c:698
char * format_type_be(Oid type_oid)
Definition: format_type.c:339
ParseNamespaceItem * p_target_nsitem
Definition: parse_node.h:193
unsigned int Oid
Definition: postgres_ext.h:31
Definition: primnodes.h:186
ParseExprKind
Definition: parse_node.h:38
signed int int32
Definition: c.h:429
Const * makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid)
Definition: makefuncs.c:337
#define linitial(l)
Definition: pg_list.h:174
#define ERROR
Definition: elog.h:46
Node * coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location)
Definition: parse_coerce.c:78
int location
Definition: primnodes.h:201
int32 typeMod
Definition: primnodes.h:1342
Oid attnumTypeId(Relation rd, int attid)
static ListCell * list_head(const List *l)
Definition: pg_list.h:125
ParseExprKind p_expr_kind
Definition: parse_node.h:196
TupleDesc rd_att
Definition: rel.h:110
#define ereport(elevel,...)
Definition: elog.h:157
#define Assert(condition)
Definition: c.h:804
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:41
int parser_errposition(ParseState *pstate, int location)
Definition: parse_node.c:111
int errmsg(const char *fmt,...)
Definition: elog.c:909
Relation p_target_relation
Definition: parse_node.h:192
bool p_is_insert
Definition: parse_node.h:194
Node * transformAssignmentIndirection(ParseState *pstate, Node *basenode, const char *targetName, bool targetIsSubscripting, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *indirection, ListCell *indirection_cell, Node *rhs, CoercionContext ccontext, int location)
Definition: parse_target.c:685

◆ transformAssignmentIndirection()

Node* transformAssignmentIndirection ( ParseState pstate,
Node basenode,
const char *  targetName,
bool  targetIsSubscripting,
Oid  targetTypeId,
int32  targetTypMod,
Oid  targetCollation,
List indirection,
ListCell indirection_cell,
Node rhs,
CoercionContext  ccontext,
int  location 
)

Definition at line 685 of file parse_target.c.

References FieldStore::arg, Assert, attnum, COERCE_IMPLICIT_CAST, coerce_to_domain(), coerce_to_target_type(), COERCION_IMPLICIT, CaseTestExpr::collation, ereport, errcode(), errhint(), errmsg(), ERROR, exprType(), FieldStore::fieldnums, for_each_cell, format_type_be(), get_attnum(), get_atttypetypmodcoll(), getBaseTypeAndTypmod(), i, InvalidAttrNumber, IsA, lappend(), lfirst, list_make1, list_make1_int, lnext(), makeNode, FieldStore::newvals, NIL, parser_errposition(), FieldStore::resulttype, strVal, transformAssignmentIndirection(), transformAssignmentSubscripts(), CaseTestExpr::typeId, typeidTypeRelid(), and CaseTestExpr::typeMod.

Referenced by transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), and transformPLAssignStmt().

697 {
698  Node *result;
699  List *subscripts = NIL;
700  bool isSlice = false;
701  ListCell *i;
702 
703  if (indirection_cell && !basenode)
704  {
705  /*
706  * Set up a substitution. We abuse CaseTestExpr for this. It's safe
707  * to do so because the only nodes that will be above the CaseTestExpr
708  * in the finished expression will be FieldStore and SubscriptingRef
709  * nodes. (There could be other stuff in the tree, but it will be
710  * within other child fields of those node types.)
711  */
713 
714  ctest->typeId = targetTypeId;
715  ctest->typeMod = targetTypMod;
716  ctest->collation = targetCollation;
717  basenode = (Node *) ctest;
718  }
719 
720  /*
721  * We have to split any field-selection operations apart from
722  * subscripting. Adjacent A_Indices nodes have to be treated as a single
723  * multidimensional subscript operation.
724  */
725  for_each_cell(i, indirection, indirection_cell)
726  {
727  Node *n = lfirst(i);
728 
729  if (IsA(n, A_Indices))
730  {
731  subscripts = lappend(subscripts, n);
732  if (((A_Indices *) n)->is_slice)
733  isSlice = true;
734  }
735  else if (IsA(n, A_Star))
736  {
737  ereport(ERROR,
738  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
739  errmsg("row expansion via \"*\" is not supported here"),
740  parser_errposition(pstate, location)));
741  }
742  else
743  {
744  FieldStore *fstore;
745  Oid baseTypeId;
746  int32 baseTypeMod;
747  Oid typrelid;
749  Oid fieldTypeId;
750  int32 fieldTypMod;
751  Oid fieldCollation;
752 
753  Assert(IsA(n, String));
754 
755  /* process subscripts before this field selection */
756  if (subscripts)
757  {
758  /* recurse, and then return because we're done */
759  return transformAssignmentSubscripts(pstate,
760  basenode,
761  targetName,
762  targetTypeId,
763  targetTypMod,
764  targetCollation,
765  subscripts,
766  isSlice,
767  indirection,
768  i,
769  rhs,
770  ccontext,
771  location);
772  }
773 
774  /* No subscripts, so can process field selection here */
775 
776  /*
777  * Look up the composite type, accounting for possibility that
778  * what we are given is a domain over composite.
779  */
780  baseTypeMod = targetTypMod;
781  baseTypeId = getBaseTypeAndTypmod(targetTypeId, &baseTypeMod);
782 
783  typrelid = typeidTypeRelid(baseTypeId);
784  if (!typrelid)
785  ereport(ERROR,
786  (errcode(ERRCODE_DATATYPE_MISMATCH),
787  errmsg("cannot assign to field \"%s\" of column \"%s\" because its type %s is not a composite type",
788  strVal(n), targetName,
789  format_type_be(targetTypeId)),
790  parser_errposition(pstate, location)));
791 
792  attnum = get_attnum(typrelid, strVal(n));
793  if (attnum == InvalidAttrNumber)
794  ereport(ERROR,
795  (errcode(ERRCODE_UNDEFINED_COLUMN),
796  errmsg("cannot assign to field \"%s\" of column \"%s\" because there is no such column in data type %s",
797  strVal(n), targetName,
798  format_type_be(targetTypeId)),
799  parser_errposition(pstate, location)));
800  if (attnum < 0)
801  ereport(ERROR,
802  (errcode(ERRCODE_UNDEFINED_COLUMN),
803  errmsg("cannot assign to system column \"%s\"",
804  strVal(n)),
805  parser_errposition(pstate, location)));
806 
807  get_atttypetypmodcoll(typrelid, attnum,
808  &fieldTypeId, &fieldTypMod, &fieldCollation);
809 
810  /* recurse to create appropriate RHS for field assign */
811  rhs = transformAssignmentIndirection(pstate,
812  NULL,
813  strVal(n),
814  false,
815  fieldTypeId,
816  fieldTypMod,
817  fieldCollation,
818  indirection,
819  lnext(indirection, i),
820  rhs,
821  ccontext,
822  location);
823 
824  /* and build a FieldStore node */
825  fstore = makeNode(FieldStore);
826  fstore->arg = (Expr *) basenode;
827  fstore->newvals = list_make1(rhs);
828  fstore->fieldnums = list_make1_int(attnum);
829  fstore->resulttype = baseTypeId;
830 
831  /* If target is a domain, apply constraints */
832  if (baseTypeId != targetTypeId)
833  return coerce_to_domain((Node *) fstore,
834  baseTypeId, baseTypeMod,
835  targetTypeId,
838  location,
839  false);
840 
841  return (Node *) fstore;
842  }
843  }
844 
845  /* process trailing subscripts, if any */
846  if (subscripts)
847  {
848  /* recurse, and then return because we're done */
849  return transformAssignmentSubscripts(pstate,
850  basenode,
851  targetName,
852  targetTypeId,
853  targetTypMod,
854  targetCollation,
855  subscripts,
856  isSlice,
857  indirection,
858  NULL,
859  rhs,
860  ccontext,
861  location);
862  }
863 
864  /* base case: just coerce RHS to match target type ID */
865 
866  result = coerce_to_target_type(pstate,
867  rhs, exprType(rhs),
868  targetTypeId, targetTypMod,
869  ccontext,
871  -1);
872  if (result == NULL)
873  {
874  if (targetIsSubscripting)
875  ereport(ERROR,
876  (errcode(ERRCODE_DATATYPE_MISMATCH),
877  errmsg("subscripted assignment to \"%s\" requires type %s"
878  " but expression is of type %s",
879  targetName,
880  format_type_be(targetTypeId),
881  format_type_be(exprType(rhs))),
882  errhint("You will need to rewrite or cast the expression."),
883  parser_errposition(pstate, location)));
884  else
885  ereport(ERROR,
886  (errcode(ERRCODE_DATATYPE_MISMATCH),
887  errmsg("subfield \"%s\" is of type %s"
888  " but expression is of type %s",
889  targetName,
890  format_type_be(targetTypeId),
891  format_type_be(exprType(rhs))),
892  errhint("You will need to rewrite or cast the expression."),
893  parser_errposition(pstate, location)));
894  }
895 
896  return result;
897 }
#define NIL
Definition: pg_list.h:65
Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod)
Definition: lsyscache.c:2485
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
Expr * arg
Definition: primnodes.h:837
int errhint(const char *fmt,...)
Definition: elog.c:1156
static ListCell * lnext(const List *l, const ListCell *c)
Definition: pg_list.h:322
#define for_each_cell(cell, lst, initcell)
Definition: pg_list.h:417
Definition: nodes.h:536
#define strVal(v)
Definition: value.h:65
int errcode(int sqlerrcode)
Definition: elog.c:698
Definition: value.h:51
char * format_type_be(Oid type_oid)
Definition: format_type.c:339
Oid typeidTypeRelid(Oid type_id)
Definition: parse_type.c:670
unsigned int Oid
Definition: postgres_ext.h:31
int32 typeMod
Definition: primnodes.h:1019
signed int int32
Definition: c.h:429
#define list_make1(x1)
Definition: pg_list.h:206
#define ERROR
Definition: elog.h:46
Node * coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location)
Definition: parse_coerce.c:78
Node * coerce_to_domain(Node *arg, Oid baseTypeId, int32 baseTypeMod, Oid typeId, CoercionContext ccontext, CoercionForm cformat, int location, bool hideInputCoercion)
Definition: parse_coerce.c:676
AttrNumber get_attnum(Oid relid, const char *attname)
Definition: lsyscache.c:856
static Node * transformAssignmentSubscripts(ParseState *pstate, Node *basenode, const char *targetName, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *subscripts, bool isSlice, List *indirection, ListCell *next_indirection, Node *rhs, CoercionContext ccontext, int location)
Definition: parse_target.c:903
Oid resulttype
Definition: primnodes.h:840
#define list_make1_int(x1)
Definition: pg_list.h:221
List * newvals
Definition: primnodes.h:838
List * lappend(List *list, void *datum)
Definition: list.c:336
int16 attnum
Definition: pg_attribute.h:83
#define ereport(elevel,...)
Definition: elog.h:157
#define makeNode(_type_)
Definition: nodes.h:584
#define Assert(condition)
Definition: c.h:804
#define lfirst(lc)
Definition: pg_list.h:169
void get_atttypetypmodcoll(Oid relid, AttrNumber attnum, Oid *typid, int32 *typmod, Oid *collid)
Definition: lsyscache.c:968
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:41
int parser_errposition(ParseState *pstate, int location)
Definition: parse_node.c:111
#define InvalidAttrNumber
Definition: attnum.h:23
int errmsg(const char *fmt,...)
Definition: elog.c:909
List * fieldnums
Definition: primnodes.h:839
int i
Definition: pg_list.h:50
int16 AttrNumber
Definition: attnum.h:21
Node * transformAssignmentIndirection(ParseState *pstate, Node *basenode, const char *targetName, bool targetIsSubscripting, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *indirection, ListCell *indirection_cell, Node *rhs, CoercionContext ccontext, int location)
Definition: parse_target.c:685

◆ transformExpressionList()

List* transformExpressionList ( ParseState pstate,
List exprlist,
ParseExprKind  exprKind,
bool  allowDefault 
)

Definition at line 222 of file parse_target.c.

References ExpandColumnRefStar(), ExpandIndirectionStar(), ColumnRef::fields, A_Indirection::indirection, IsA, lappend(), lfirst, list_concat(), llast, NIL, and transformExpr().

Referenced by transformInsertStmt(), transformRowExpr(), and transformValuesClause().

224 {
225  List *result = NIL;
226  ListCell *lc;
227 
228  foreach(lc, exprlist)
229  {
230  Node *e = (Node *) lfirst(lc);
231 
232  /*
233  * Check for "something.*". Depending on the complexity of the
234  * "something", the star could appear as the last field in ColumnRef,
235  * or as the last indirection item in A_Indirection.
236  */
237  if (IsA(e, ColumnRef))
238  {
239  ColumnRef *cref = (ColumnRef *) e;
240 
241  if (IsA(llast(cref->fields), A_Star))
242  {
243  /* It is something.*, expand into multiple items */
244  result = list_concat(result,
245  ExpandColumnRefStar(pstate, cref,
246  false));
247  continue;
248  }
249  }
250  else if (IsA(e, A_Indirection))
251  {
253 
254  if (IsA(llast(ind->indirection), A_Star))
255  {
256  /* It is something.*, expand into multiple items */
257  result = list_concat(result,
258  ExpandIndirectionStar(pstate, ind,
259  false, exprKind));
260  continue;
261  }
262  }
263 
264  /*
265  * Not "something.*", so transform as a single expression. If it's a
266  * SetToDefault node and we should allow that, pass it through
267  * unmodified. (transformExpr will throw the appropriate error if
268  * we're disallowing it.)
269  */
270  if (allowDefault && IsA(e, SetToDefault))
271  /* do nothing */ ;
272  else
273  e = transformExpr(pstate, e, exprKind);
274 
275  result = lappend(result, e);
276  }
277 
278  return result;
279 }
#define NIL
Definition: pg_list.h:65
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
Definition: parse_expr.c:94
#define llast(l)
Definition: pg_list.h:194
Definition: nodes.h:536
List * list_concat(List *list1, const List *list2)
Definition: list.c:530
static List * ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref, bool make_target_entry)
struct A_Star A_Star
static List * ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind, bool make_target_entry, ParseExprKind exprKind)
List * lappend(List *list, void *datum)
Definition: list.c:336
#define lfirst(lc)
Definition: pg_list.h:169
List * indirection
Definition: parsenodes.h:430
e
Definition: preproc-init.c:82
Definition: pg_list.h:50
List * fields
Definition: parsenodes.h:247

◆ transformTargetEntry()

TargetEntry* transformTargetEntry ( ParseState pstate,
Node node,
Node expr,
ParseExprKind  exprKind,
char *  colname,
bool  resjunk 
)

Definition at line 77 of file parse_target.c.

References EXPR_KIND_UPDATE_SOURCE, FigureColname(), IsA, makeTargetEntry(), ParseState::p_next_resno, and transformExpr().

Referenced by findTargetlistEntrySQL99(), and transformTargetList().

83 {
84  /* Transform the node if caller didn't do it already */
85  if (expr == NULL)
86  {
87  /*
88  * If it's a SetToDefault node and we should allow that, pass it
89  * through unmodified. (transformExpr will throw the appropriate
90  * error if we're disallowing it.)
91  */
92  if (exprKind == EXPR_KIND_UPDATE_SOURCE && IsA(node, SetToDefault))
93  expr = node;
94  else
95  expr = transformExpr(pstate, node, exprKind);
96  }
97 
98  if (colname == NULL && !resjunk)
99  {
100  /*
101  * Generate a suitable column name for a column without any explicit
102  * 'AS ColumnName' clause.
103  */
104  colname = FigureColname(node);
105  }
106 
107  return makeTargetEntry((Expr *) expr,
108  (AttrNumber) pstate->p_next_resno++,
109  colname,
110  resjunk);
111 }
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
Definition: parse_expr.c:94
char * FigureColname(Node *node)
int p_next_resno
Definition: parse_node.h:197
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
Definition: makefuncs.c:238
int16 AttrNumber
Definition: attnum.h:21

◆ transformTargetList()

List* transformTargetList ( ParseState pstate,
List targetlist,
ParseExprKind  exprKind 
)

Definition at line 123 of file parse_target.c.

References Assert, ExpandColumnRefStar(), ExpandIndirectionStar(), EXPR_KIND_UPDATE_SOURCE, ColumnRef::fields, A_Indirection::indirection, IsA, lappend(), lfirst, list_concat(), llast, ResTarget::name, NIL, ParseState::p_multiassign_exprs, transformTargetEntry(), and ResTarget::val.

Referenced by transformPLAssignStmt(), transformReturningList(), transformSelectStmt(), and transformUpdateTargetList().

125 {
126  List *p_target = NIL;
127  bool expand_star;
128  ListCell *o_target;
129 
130  /* Shouldn't have any leftover multiassign items at start */
131  Assert(pstate->p_multiassign_exprs == NIL);
132 
133  /* Expand "something.*" in SELECT and RETURNING, but not UPDATE */
134  expand_star = (exprKind != EXPR_KIND_UPDATE_SOURCE);
135 
136  foreach(o_target, targetlist)
137  {
138  ResTarget *res = (ResTarget *) lfirst(o_target);
139 
140  /*
141  * Check for "something.*". Depending on the complexity of the
142  * "something", the star could appear as the last field in ColumnRef,
143  * or as the last indirection item in A_Indirection.
144  */
145  if (expand_star)
146  {
147  if (IsA(res->val, ColumnRef))
148  {
149  ColumnRef *cref = (ColumnRef *) res->val;
150 
151  if (IsA(llast(cref->fields), A_Star))
152  {
153  /* It is something.*, expand into multiple items */
154  p_target = list_concat(p_target,
155  ExpandColumnRefStar(pstate,
156  cref,
157  true));
158  continue;
159  }
160  }
161  else if (IsA(res->val, A_Indirection))
162  {
163  A_Indirection *ind = (A_Indirection *) res->val;
164 
165  if (IsA(llast(ind->indirection), A_Star))
166  {
167  /* It is something.*, expand into multiple items */
168  p_target = list_concat(p_target,
169  ExpandIndirectionStar(pstate,
170  ind,
171  true,
172  exprKind));
173  continue;
174  }
175  }
176  }
177 
178  /*
179  * Not "something.*", or we want to treat that as a plain whole-row
180  * variable, so transform as a single expression
181  */
182  p_target = lappend(p_target,
183  transformTargetEntry(pstate,
184  res->val,
185  NULL,
186  exprKind,
187  res->name,
188  false));
189  }
190 
191  /*
192  * If any multiassign resjunk items were created, attach them to the end
193  * of the targetlist. This should only happen in an UPDATE tlist. We
194  * don't need to worry about numbering of these items; transformUpdateStmt
195  * will set their resnos.
196  */
197  if (pstate->p_multiassign_exprs)
198  {
199  Assert(exprKind == EXPR_KIND_UPDATE_SOURCE);
200  p_target = list_concat(p_target, pstate->p_multiassign_exprs);
201  pstate->p_multiassign_exprs = NIL;
202  }
203 
204  return p_target;
205 }
#define NIL
Definition: pg_list.h:65
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
Node * val
Definition: parsenodes.h:466
char * name
Definition: parsenodes.h:464
#define llast(l)
Definition: pg_list.h:194
List * list_concat(List *list1, const List *list2)
Definition: list.c:530
List * p_multiassign_exprs
Definition: parse_node.h:198
static List * ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref, bool make_target_entry)
struct A_Star A_Star
static List * ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind, bool make_target_entry, ParseExprKind exprKind)
List * lappend(List *list, void *datum)
Definition: list.c:336
#define Assert(condition)
Definition: c.h:804
#define lfirst(lc)
Definition: pg_list.h:169
List * indirection
Definition: parsenodes.h:430
TargetEntry * transformTargetEntry(ParseState *pstate, Node *node, Node *expr, ParseExprKind exprKind, char *colname, bool resjunk)
Definition: parse_target.c:77
Definition: pg_list.h:50
List * fields
Definition: parsenodes.h:247

◆ updateTargetListEntry()

void updateTargetListEntry ( ParseState pstate,
TargetEntry tle,
char *  colname,
int  attrno,
List indirection,
int  location 
)

Definition at line 621 of file parse_target.c.

References TargetEntry::expr, EXPR_KIND_UPDATE_TARGET, TargetEntry::resname, TargetEntry::resno, and transformAssignedExpr().

Referenced by transformUpdateTargetList().

627 {
628  /* Fix up expression as needed */
629  tle->expr = transformAssignedExpr(pstate,
630  tle->expr,
632  colname,
633  attrno,
634  indirection,
635  location);
636 
637  /*
638  * Set the resno to identify the target column --- the rewriter and
639  * planner depend on this. We also set the resname to identify the target
640  * column, but this is only for debugging purposes; it should not be
641  * relied on. (In particular, it might be out of date in a stored rule.)
642  */
643  tle->resno = (AttrNumber) attrno;
644  tle->resname = colname;
645 }
Expr * transformAssignedExpr(ParseState *pstate, Expr *expr, ParseExprKind exprKind, const char *colname, int attrno, List *indirection, int location)
Definition: parse_target.c:454
char * resname
Definition: primnodes.h:1457
AttrNumber resno
Definition: primnodes.h:1456
Expr * expr
Definition: primnodes.h:1455
int16 AttrNumber
Definition: attnum.h:21