PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
makefuncs.c File Reference
#include "postgres.h"
#include "catalog/pg_class.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "utils/lsyscache.h"
Include dependency graph for makefuncs.c:

Go to the source code of this file.

Functions

A_ExprmakeA_Expr (A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr, int location)
 
A_ExprmakeSimpleA_Expr (A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location)
 
VarmakeVar (int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
 
VarmakeVarFromTargetEntry (int varno, TargetEntry *tle)
 
VarmakeWholeRowVar (RangeTblEntry *rte, int varno, Index varlevelsup, bool allowScalar)
 
TargetEntrymakeTargetEntry (Expr *expr, AttrNumber resno, char *resname, bool resjunk)
 
TargetEntryflatCopyTargetEntry (TargetEntry *src_tle)
 
FromExprmakeFromExpr (List *fromlist, Node *quals)
 
ConstmakeConst (Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
 
ConstmakeNullConst (Oid consttype, int32 consttypmod, Oid constcollid)
 
NodemakeBoolConst (bool value, bool isnull)
 
ExprmakeBoolExpr (BoolExprType boolop, List *args, int location)
 
AliasmakeAlias (const char *aliasname, List *colnames)
 
RelabelTypemakeRelabelType (Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat)
 
RangeVarmakeRangeVar (char *schemaname, char *relname, int location)
 
ConstraintmakeNotNullConstraint (String *colname)
 
TypeNamemakeTypeName (char *typnam)
 
TypeNamemakeTypeNameFromNameList (List *names)
 
TypeNamemakeTypeNameFromOid (Oid typeOid, int32 typmod)
 
ColumnDefmakeColumnDef (const char *colname, Oid typeOid, int32 typmod, Oid collOid)
 
FuncExprmakeFuncExpr (Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat)
 
NodemakeStringConst (char *str, int location)
 
DefElemmakeDefElem (char *name, Node *arg, int location)
 
DefElemmakeDefElemExtended (char *nameSpace, char *name, Node *arg, DefElemAction defaction, int location)
 
FuncCallmakeFuncCall (List *name, List *args, CoercionForm funcformat, int location)
 
Exprmake_opclause (Oid opno, Oid opresulttype, bool opretset, Expr *leftop, Expr *rightop, Oid opcollid, Oid inputcollid)
 
Exprmake_andclause (List *andclauses)
 
Exprmake_orclause (List *orclauses)
 
Exprmake_notclause (Expr *notclause)
 
Nodemake_and_qual (Node *qual1, Node *qual2)
 
Exprmake_ands_explicit (List *andclauses)
 
Listmake_ands_implicit (Expr *clause)
 
IndexInfomakeIndexInfo (int numattrs, int numkeyattrs, Oid amoid, List *expressions, List *predicates, bool unique, bool nulls_not_distinct, bool isready, bool concurrent, bool summarizing, bool withoutoverlaps)
 
GroupingSetmakeGroupingSet (GroupingSetKind kind, List *content, int location)
 
VacuumRelationmakeVacuumRelation (RangeVar *relation, Oid oid, List *va_cols)
 
JsonFormatmakeJsonFormat (JsonFormatType type, JsonEncoding encoding, int location)
 
JsonValueExprmakeJsonValueExpr (Expr *raw_expr, Expr *formatted_expr, JsonFormat *format)
 
JsonBehaviormakeJsonBehavior (JsonBehaviorType btype, Node *expr, int location)
 
NodemakeJsonKeyValue (Node *key, Node *value)
 
NodemakeJsonIsPredicate (Node *expr, JsonFormat *format, JsonValueType item_type, bool unique_keys, int location)
 
JsonTablePathSpecmakeJsonTablePathSpec (char *string, char *name, int string_location, int name_location)
 
JsonTablePathmakeJsonTablePath (Const *pathvalue, char *pathname)
 

Function Documentation

◆ flatCopyTargetEntry()

TargetEntry* flatCopyTargetEntry ( TargetEntry src_tle)

Definition at line 273 of file makefuncs.c.

274 {
276 
277  Assert(IsA(src_tle, TargetEntry));
278  memcpy(tle, src_tle, sizeof(TargetEntry));
279  return tle;
280 }
#define Assert(condition)
Definition: c.h:863
#define IsA(nodeptr, _type_)
Definition: nodes.h:158
#define makeNode(_type_)
Definition: nodes.h:155

References Assert, IsA, and makeNode.

Referenced by expand_insert_targetlist(), process_matched_tle(), rewriteTargetListIU(), set_dummy_tlist_references(), and set_upper_references().

◆ make_and_qual()

Node* make_and_qual ( Node qual1,
Node qual2 
)

Definition at line 730 of file makefuncs.c.

731 {
732  if (qual1 == NULL)
733  return qual2;
734  if (qual2 == NULL)
735  return qual1;
736  return (Node *) make_andclause(list_make2(qual1, qual2));
737 }
Expr * make_andclause(List *andclauses)
Definition: makefuncs.c:677
#define list_make2(x1, x2)
Definition: pg_list.h:214
Definition: nodes.h:129

References list_make2, and make_andclause().

Referenced by AddQual(), subquery_push_qual(), and transform_MERGE_to_join().

◆ make_andclause()

Expr* make_andclause ( List andclauses)

Definition at line 677 of file makefuncs.c.

678 {
679  BoolExpr *expr = makeNode(BoolExpr);
680 
681  expr->boolop = AND_EXPR;
682  expr->args = andclauses;
683  expr->location = -1;
684  return (Expr *) expr;
685 }
@ AND_EXPR
Definition: primnodes.h:931
BoolExprType boolop
Definition: primnodes.h:939
List * args
Definition: primnodes.h:940
ParseLoc location
Definition: primnodes.h:941

References AND_EXPR, BoolExpr::args, BoolExpr::boolop, BoolExpr::location, and makeNode.

Referenced by eval_const_expressions_mutator(), ExplainNode(), find_duplicate_ors(), find_simplified_clause(), make_and_qual(), make_ands_explicit(), make_sub_restrictinfos(), negate_clause(), process_duplicate_ors(), process_sublinks_mutator(), and pull_up_sublinks_qual_recurse().

◆ make_ands_explicit()

Expr* make_ands_explicit ( List andclauses)

Definition at line 749 of file makefuncs.c.

750 {
751  if (andclauses == NIL)
752  return (Expr *) makeBoolConst(true, false);
753  else if (list_length(andclauses) == 1)
754  return (Expr *) linitial(andclauses);
755  else
756  return make_andclause(andclauses);
757 }
Node * makeBoolConst(bool value, bool isnull)
Definition: makefuncs.c:359
static int list_length(const List *l)
Definition: pg_list.h:152
#define NIL
Definition: pg_list.h:68
#define linitial(l)
Definition: pg_list.h:178

References linitial, list_length(), make_andclause(), makeBoolConst(), and NIL.

Referenced by ATExecAttachPartition(), check_default_partition_contents(), convert_EXISTS_to_ANY(), create_bitmap_subplan(), DetachAddConstraintIfNeeded(), ExecInitCheck(), extract_or_clause(), get_proposed_default_constraint(), get_qual_for_list(), show_qual(), and UpdateIndexRelation().

◆ make_ands_implicit()

List* make_ands_implicit ( Expr clause)

Definition at line 760 of file makefuncs.c.

761 {
762  /*
763  * NB: because the parser sets the qual field to NULL in a query that has
764  * no WHERE clause, we must consider a NULL input clause as TRUE, even
765  * though one might more reasonably think it FALSE.
766  */
767  if (clause == NULL)
768  return NIL; /* NULL -> NIL list == TRUE */
769  else if (is_andclause(clause))
770  return ((BoolExpr *) clause)->args;
771  else if (IsA(clause, Const) &&
772  !((Const *) clause)->constisnull &&
773  DatumGetBool(((Const *) clause)->constvalue))
774  return NIL; /* constant TRUE input -> NIL list */
775  else
776  return list_make1(clause);
777 }
static bool is_andclause(const void *clause)
Definition: nodeFuncs.h:107
#define list_make1(x1)
Definition: pg_list.h:212
static bool DatumGetBool(Datum X)
Definition: postgres.h:90

References DatumGetBool(), is_andclause(), IsA, list_make1, and NIL.

Referenced by apply_child_basequals(), ConstraintImpliedByRelConstraint(), convert_EXISTS_to_ANY(), cost_subplan(), DefineIndex(), DoCopy(), get_proposed_default_constraint(), get_relation_constraints(), index_concurrently_create_copy(), preprocess_expression(), RelationGetIndexPredicate(), test_predtest(), and TriggerEnabled().

◆ make_notclause()

Expr* make_notclause ( Expr notclause)

Definition at line 709 of file makefuncs.c.

710 {
711  BoolExpr *expr = makeNode(BoolExpr);
712 
713  expr->boolop = NOT_EXPR;
714  expr->args = list_make1(notclause);
715  expr->location = -1;
716  return (Expr *) expr;
717 }
@ NOT_EXPR
Definition: primnodes.h:931

References BoolExpr::args, BoolExpr::boolop, list_make1, BoolExpr::location, makeNode, and NOT_EXPR.

Referenced by negate_clause().

◆ make_opclause()

Expr* make_opclause ( Oid  opno,
Oid  opresulttype,
bool  opretset,
Expr leftop,
Expr rightop,
Oid  opcollid,
Oid  inputcollid 
)

Definition at line 651 of file makefuncs.c.

654 {
655  OpExpr *expr = makeNode(OpExpr);
656 
657  expr->opno = opno;
658  expr->opfuncid = InvalidOid;
659  expr->opresulttype = opresulttype;
660  expr->opretset = opretset;
661  expr->opcollid = opcollid;
662  expr->inputcollid = inputcollid;
663  if (rightop)
664  expr->args = list_make2(leftop, rightop);
665  else
666  expr->args = list_make1(leftop);
667  expr->location = -1;
668  return (Expr *) expr;
669 }
#define InvalidOid
Definition: postgres_ext.h:36
Oid opno
Definition: primnodes.h:818
List * args
Definition: primnodes.h:836
ParseLoc location
Definition: primnodes.h:839

References OpExpr::args, InvalidOid, list_make1, list_make2, OpExpr::location, makeNode, and OpExpr::opno.

Referenced by build_bound_expr(), build_implied_join_equality(), convert_EXISTS_to_ANY(), create_one_window_path(), expand_indexqual_rowcompare(), make_partition_op_expr(), match_boolean_index_clause(), match_clause_to_partition_key(), match_network_subset(), match_pattern_prefix(), operator_predicate_proof(), process_implied_equality(), and rewriteSearchAndCycle().

◆ make_orclause()

Expr* make_orclause ( List orclauses)

◆ makeA_Expr()

A_Expr* makeA_Expr ( A_Expr_Kind  kind,
List name,
Node lexpr,
Node rexpr,
int  location 
)

Definition at line 30 of file makefuncs.c.

32 {
33  A_Expr *a = makeNode(A_Expr);
34 
35  a->kind = kind;
36  a->name = name;
37  a->lexpr = lexpr;
38  a->rexpr = rexpr;
39  a->location = location;
40  return a;
41 }
int a
Definition: isn.c:68
const char * name

References a, makeNode, and name.

◆ makeAlias()

◆ makeBoolConst()

Node* makeBoolConst ( bool  value,
bool  isnull 
)

Definition at line 359 of file makefuncs.c.

360 {
361  /* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
362  return (Node *) makeConst(BOOLOID, -1, InvalidOid, 1,
363  BoolGetDatum(value), isnull, true);
364 }
static struct @160 value
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Definition: makefuncs.c:301
static Datum BoolGetDatum(bool X)
Definition: postgres.h:102

References BoolGetDatum(), InvalidOid, makeConst(), and value.

Referenced by add_base_clause_to_rel(), add_join_clause_to_rels(), create_append_plan(), eval_const_expressions_mutator(), find_duplicate_ors(), find_simplified_clause(), get_qual_for_range(), make_ands_explicit(), make_row_distinct_op(), match_boolean_index_clause(), match_boolean_partition_clause(), negate_clause(), process_duplicate_ors(), and reconsider_outer_join_clauses().

◆ makeBoolExpr()

◆ makeColumnDef()

ColumnDef* makeColumnDef ( const char *  colname,
Oid  typeOid,
int32  typmod,
Oid  collOid 
)

Definition at line 515 of file makefuncs.c.

516 {
518 
519  n->colname = pstrdup(colname);
520  n->typeName = makeTypeNameFromOid(typeOid, typmod);
521  n->inhcount = 0;
522  n->is_local = true;
523  n->is_not_null = false;
524  n->is_from_type = false;
525  n->storage = 0;
526  n->raw_default = NULL;
527  n->cooked_default = NULL;
528  n->collClause = NULL;
529  n->collOid = collOid;
530  n->constraints = NIL;
531  n->fdwoptions = NIL;
532  n->location = -1;
533 
534  return n;
535 }
TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod)
Definition: makefuncs.c:497
bool is_not_null
Definition: parsenodes.h:733
CollateClause * collClause
Definition: parsenodes.h:743
List * constraints
Definition: parsenodes.h:745
Node * cooked_default
Definition: parsenodes.h:738
char * colname
Definition: parsenodes.h:728
TypeName * typeName
Definition: parsenodes.h:729
bool is_from_type
Definition: parsenodes.h:734
List * fdwoptions
Definition: parsenodes.h:746
Node * raw_default
Definition: parsenodes.h:737
char storage
Definition: parsenodes.h:735
Oid collOid
Definition: parsenodes.h:744
bool is_local
Definition: parsenodes.h:732
int16 inhcount
Definition: parsenodes.h:731
ParseLoc location
Definition: parsenodes.h:747

References ColumnDef::collClause, ColumnDef::collOid, ColumnDef::colname, ColumnDef::constraints, ColumnDef::cooked_default, ColumnDef::fdwoptions, ColumnDef::inhcount, ColumnDef::is_from_type, ColumnDef::is_local, ColumnDef::is_not_null, ColumnDef::location, makeNode, makeTypeNameFromOid(), NIL, pstrdup(), ColumnDef::raw_default, ColumnDef::storage, and ColumnDef::typeName.

Referenced by create_ctas_nodata(), DefineSequence(), DefineVirtualRelation(), intorel_startup(), MergeAttributes(), transformOfType(), and transformTableLikeClause().

◆ makeConst()

Const* makeConst ( Oid  consttype,
int32  consttypmod,
Oid  constcollid,
int  constlen,
Datum  constvalue,
bool  constisnull,
bool  constbyval 
)

Definition at line 301 of file makefuncs.c.

308 {
309  Const *cnst = makeNode(Const);
310 
311  /*
312  * If it's a varlena value, force it to be in non-expanded (non-toasted)
313  * format; this avoids any possible dependency on external values and
314  * improves consistency of representation, which is important for equal().
315  */
316  if (!constisnull && constlen == -1)
317  constvalue = PointerGetDatum(PG_DETOAST_DATUM(constvalue));
318 
319  cnst->consttype = consttype;
320  cnst->consttypmod = consttypmod;
321  cnst->constcollid = constcollid;
322  cnst->constlen = constlen;
323  cnst->constvalue = constvalue;
324  cnst->constisnull = constisnull;
325  cnst->constbyval = constbyval;
326  cnst->location = -1; /* "unknown" */
327 
328  return cnst;
329 }
#define PG_DETOAST_DATUM(datum)
Definition: fmgr.h:240
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:322
Oid consttype
Definition: primnodes.h:312

References Const::consttype, makeNode, PG_DETOAST_DATUM, and PointerGetDatum().

Referenced by add_security_quals(), add_with_check_options(), array_subscript_transform(), build_bound_expr(), build_coercion_expression(), build_minmax_path(), check_sql_fn_retval(), create_final_distinct_paths(), create_partial_distinct_paths(), eval_const_expressions_mutator(), evaluate_expr(), expand_insert_targetlist(), generate_setop_tlist(), get_qual_for_hash(), get_qual_for_list(), get_typdefault(), GetJsonBehaviorConst(), getJsonEncodingConst(), make_const(), makeBoolConst(), makeJsonTablePathScan(), makeNullConst(), match_clause_to_partition_key(), match_network_subset(), match_orclause_to_indexcol(), pattern_fixed_prefix(), RelationGetDummyIndexExpressions(), rewriteSearchAndCycle(), rewriteTargetListIU(), rewriteValuesRTE(), scalararraysel(), set_fn_opclass_options(), string_to_bytea_const(), string_to_const(), and transformJsonBehavior().

◆ makeDefElem()

DefElem* makeDefElem ( char *  name,
Node arg,
int  location 
)

Definition at line 587 of file makefuncs.c.

588 {
590 
591  res->defnamespace = NULL;
592  res->defname = name;
593  res->arg = arg;
594  res->defaction = DEFELEM_UNSPEC;
595  res->location = location;
596 
597  return res;
598 }
@ DEFELEM_UNSPEC
Definition: parsenodes.h:807
void * arg

References arg, DEFELEM_UNSPEC, makeNode, name, and res.

Referenced by buildDefItem(), copy_table(), DefineView(), fileGetForeignPaths(), generateSerialExtraStmts(), get_file_fdw_attribute_options(), pg_logical_slot_get_changes_guts(), sequence_options(), transformAlterTableStmt(), and untransformRelOptions().

◆ makeDefElemExtended()

DefElem* makeDefElemExtended ( char *  nameSpace,
char *  name,
Node arg,
DefElemAction  defaction,
int  location 
)

Definition at line 605 of file makefuncs.c.

607 {
609 
610  res->defnamespace = nameSpace;
611  res->defname = name;
612  res->arg = arg;
613  res->defaction = defaction;
614  res->location = location;
615 
616  return res;
617 }

References arg, makeNode, name, and res.

◆ makeFromExpr()

◆ makeFuncCall()

FuncCall* makeFuncCall ( List name,
List args,
CoercionForm  funcformat,
int  location 
)

Definition at line 626 of file makefuncs.c.

627 {
628  FuncCall *n = makeNode(FuncCall);
629 
630  n->funcname = name;
631  n->args = args;
632  n->agg_order = NIL;
633  n->agg_filter = NULL;
634  n->over = NULL;
635  n->agg_within_group = false;
636  n->agg_star = false;
637  n->agg_distinct = false;
638  n->func_variadic = false;
639  n->funcformat = funcformat;
640  n->location = location;
641  return n;
642 }
bool agg_within_group
Definition: parsenodes.h:433
CoercionForm funcformat
Definition: parsenodes.h:437
Node * agg_filter
Definition: parsenodes.h:431
List * agg_order
Definition: parsenodes.h:430
List * funcname
Definition: parsenodes.h:428
List * args
Definition: parsenodes.h:429
bool agg_star
Definition: parsenodes.h:434
bool agg_distinct
Definition: parsenodes.h:435
ParseLoc location
Definition: parsenodes.h:438
bool func_variadic
Definition: parsenodes.h:436
struct WindowDef * over
Definition: parsenodes.h:432

References FuncCall::agg_distinct, FuncCall::agg_filter, FuncCall::agg_order, FuncCall::agg_star, FuncCall::agg_within_group, generate_unaccent_rules::args, FuncCall::args, FuncCall::func_variadic, FuncCall::funcformat, FuncCall::funcname, FuncCall::location, makeNode, name, NIL, and FuncCall::over.

Referenced by test_rls_hooks_permissive(), test_rls_hooks_restrictive(), transformColumnDefinition(), and transformRangeFunction().

◆ makeFuncExpr()

FuncExpr* makeFuncExpr ( Oid  funcid,
Oid  rettype,
List args,
Oid  funccollid,
Oid  inputcollid,
CoercionForm  fformat 
)

Definition at line 544 of file makefuncs.c.

546 {
547  FuncExpr *funcexpr;
548 
549  funcexpr = makeNode(FuncExpr);
550  funcexpr->funcid = funcid;
551  funcexpr->funcresulttype = rettype;
552  funcexpr->funcretset = false; /* only allowed case here */
553  funcexpr->funcvariadic = false; /* only allowed case here */
554  funcexpr->funcformat = fformat;
555  funcexpr->funccollid = funccollid;
556  funcexpr->inputcollid = inputcollid;
557  funcexpr->args = args;
558  funcexpr->location = -1;
559 
560  return funcexpr;
561 }
ParseLoc location
Definition: primnodes.h:770
Oid funcid
Definition: primnodes.h:750
List * args
Definition: primnodes.h:768

References generate_unaccent_rules::args, FuncExpr::args, FuncExpr::funcid, FuncExpr::location, and makeNode.

Referenced by build_aggregate_deserialfn_expr(), build_aggregate_finalfn_expr(), build_aggregate_serialfn_expr(), build_aggregate_transfn_expr(), build_coercion_expression(), coerceJsonFuncExpr(), get_qual_for_hash(), make_path_cat_expr(), makeJsonByteaToTextConversion(), rewriteSearchAndCycle(), and transformJsonValueExpr().

◆ makeGroupingSet()

GroupingSet* makeGroupingSet ( GroupingSetKind  kind,
List content,
int  location 
)

Definition at line 842 of file makefuncs.c.

843 {
845 
846  n->kind = kind;
847  n->content = content;
848  n->location = location;
849  return n;
850 }
List * content
Definition: parsenodes.h:1510
ParseLoc location
Definition: parsenodes.h:1511

References GroupingSet::content, GroupingSet::location, and makeNode.

Referenced by flatten_grouping_sets(), transformGroupClause(), and transformGroupingSet().

◆ makeIndexInfo()

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 at line 784 of file makefuncs.c.

788 {
790 
791  n->ii_NumIndexAttrs = numattrs;
792  n->ii_NumIndexKeyAttrs = numkeyattrs;
793  Assert(n->ii_NumIndexKeyAttrs != 0);
795  n->ii_Unique = unique;
796  n->ii_NullsNotDistinct = nulls_not_distinct;
797  n->ii_ReadyForInserts = isready;
798  n->ii_CheckedUnchanged = false;
799  n->ii_IndexUnchanged = false;
800  n->ii_Concurrent = concurrent;
801  n->ii_Summarizing = summarizing;
802  n->ii_WithoutOverlaps = withoutoverlaps;
803 
804  /* summarizing indexes cannot contain non-key attributes */
805  Assert(!summarizing || (numkeyattrs == numattrs));
806 
807  /* expressions */
808  n->ii_Expressions = expressions;
810 
811  /* predicates */
812  n->ii_Predicate = predicates;
813  n->ii_PredicateState = NULL;
814 
815  /* exclusion constraints */
816  n->ii_ExclusionOps = NULL;
817  n->ii_ExclusionProcs = NULL;
818  n->ii_ExclusionStrats = NULL;
819 
820  /* speculative inserts */
821  n->ii_UniqueOps = NULL;
822  n->ii_UniqueProcs = NULL;
823  n->ii_UniqueStrats = NULL;
824 
825  /* initialize index-build state to default */
826  n->ii_BrokenHotChain = false;
827  n->ii_ParallelWorkers = 0;
828 
829  /* set up for possible use by index AM */
830  n->ii_Am = amoid;
831  n->ii_AmCache = NULL;
833 
834  return n;
835 }
MemoryContext CurrentMemoryContext
Definition: mcxt.c:143
bool ii_Unique
Definition: execnodes.h:199
uint16 * ii_ExclusionStrats
Definition: execnodes.h:195
bool ii_BrokenHotChain
Definition: execnodes.h:205
int ii_NumIndexAttrs
Definition: execnodes.h:186
void * ii_AmCache
Definition: execnodes.h:210
bool ii_CheckedUnchanged
Definition: execnodes.h:202
Oid * ii_UniqueOps
Definition: execnodes.h:196
ExprState * ii_PredicateState
Definition: execnodes.h:192
Oid * ii_ExclusionOps
Definition: execnodes.h:193
bool ii_NullsNotDistinct
Definition: execnodes.h:200
int ii_ParallelWorkers
Definition: execnodes.h:208
bool ii_Concurrent
Definition: execnodes.h:204
uint16 * ii_UniqueStrats
Definition: execnodes.h:198
int ii_NumIndexKeyAttrs
Definition: execnodes.h:187
List * ii_ExpressionsState
Definition: execnodes.h:190
List * ii_Expressions
Definition: execnodes.h:189
bool ii_WithoutOverlaps
Definition: execnodes.h:207
bool ii_IndexUnchanged
Definition: execnodes.h:203
Oid * ii_ExclusionProcs
Definition: execnodes.h:194
Oid ii_Am
Definition: execnodes.h:209
bool ii_Summarizing
Definition: execnodes.h:206
Oid * ii_UniqueProcs
Definition: execnodes.h:197
MemoryContext ii_Context
Definition: execnodes.h:211
bool ii_ReadyForInserts
Definition: execnodes.h:201
List * ii_Predicate
Definition: execnodes.h:191

References Assert, CurrentMemoryContext, IndexInfo::ii_Am, IndexInfo::ii_AmCache, IndexInfo::ii_BrokenHotChain, IndexInfo::ii_CheckedUnchanged, IndexInfo::ii_Concurrent, IndexInfo::ii_Context, IndexInfo::ii_ExclusionOps, IndexInfo::ii_ExclusionProcs, IndexInfo::ii_ExclusionStrats, IndexInfo::ii_Expressions, IndexInfo::ii_ExpressionsState, IndexInfo::ii_IndexUnchanged, IndexInfo::ii_NullsNotDistinct, IndexInfo::ii_NumIndexAttrs, IndexInfo::ii_NumIndexKeyAttrs, IndexInfo::ii_ParallelWorkers, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, IndexInfo::ii_ReadyForInserts, IndexInfo::ii_Summarizing, IndexInfo::ii_Unique, IndexInfo::ii_UniqueOps, IndexInfo::ii_UniqueProcs, IndexInfo::ii_UniqueStrats, IndexInfo::ii_WithoutOverlaps, makeNode, and NIL.

Referenced by BuildDummyIndexInfo(), BuildIndexInfo(), CheckIndexCompatible(), DefineIndex(), and index_concurrently_create_copy().

◆ makeJsonBehavior()

JsonBehavior* makeJsonBehavior ( JsonBehaviorType  btype,
Node expr,
int  location 
)

Definition at line 905 of file makefuncs.c.

906 {
907  JsonBehavior *behavior = makeNode(JsonBehavior);
908 
909  behavior->btype = btype;
910  behavior->expr = expr;
911  behavior->location = location;
912 
913  return behavior;
914 }
Node * expr
Definition: primnodes.h:1791
ParseLoc location
Definition: primnodes.h:1793
JsonBehaviorType btype
Definition: primnodes.h:1790

References JsonBehavior::btype, JsonBehavior::expr, JsonBehavior::location, and makeNode.

Referenced by transformJsonBehavior().

◆ makeJsonFormat()

JsonFormat* makeJsonFormat ( JsonFormatType  type,
JsonEncoding  encoding,
int  location 
)

Definition at line 872 of file makefuncs.c.

873 {
875 
876  jf->format_type = type;
877  jf->encoding = encoding;
878  jf->location = location;
879 
880  return jf;
881 }
int32 encoding
Definition: pg_database.h:41
ParseLoc location
Definition: primnodes.h:1653
JsonEncoding encoding
Definition: primnodes.h:1652
JsonFormatType format_type
Definition: primnodes.h:1651
const char * type

References encoding, JsonFormat::encoding, JsonFormat::format_type, JsonFormat::location, makeNode, and type.

Referenced by transformJsonOutput(), transformJsonReturning(), transformJsonSerializeExpr(), and transformJsonTableColumn().

◆ makeJsonIsPredicate()

Node* makeJsonIsPredicate ( Node expr,
JsonFormat format,
JsonValueType  item_type,
bool  unique_keys,
int  location 
)

Definition at line 936 of file makefuncs.c.

938 {
940 
941  n->expr = expr;
942  n->format = format;
943  n->item_type = item_type;
944  n->unique_keys = unique_keys;
945  n->location = location;
946 
947  return (Node *) n;
948 }
static char format
JsonFormat * format
Definition: primnodes.h:1736
JsonValueType item_type
Definition: primnodes.h:1737
ParseLoc location
Definition: primnodes.h:1739

References JsonIsPredicate::expr, format, JsonIsPredicate::format, JsonIsPredicate::item_type, JsonIsPredicate::location, makeNode, and JsonIsPredicate::unique_keys.

Referenced by transformJsonIsPredicate().

◆ makeJsonKeyValue()

Node* makeJsonKeyValue ( Node key,
Node value 
)

Definition at line 921 of file makefuncs.c.

922 {
924 
925  n->key = (Expr *) key;
927 
928  return (Node *) n;
929 }
#define castNode(_type_, nodeptr)
Definition: nodes.h:176
JsonValueExpr * value
Definition: parsenodes.h:1876

References castNode, JsonKeyValue::key, sort-test::key, makeNode, JsonKeyValue::value, and value.

◆ makeJsonTablePath()

JsonTablePath* makeJsonTablePath ( Const pathvalue,
char *  pathname 
)

Definition at line 976 of file makefuncs.c.

977 {
979 
980  Assert(IsA(pathvalue, Const));
981  path->value = pathvalue;
982  path->name = pathname;
983 
984  return path;
985 }
Const * value
Definition: primnodes.h:1871

References Assert, IsA, makeNode, JsonTablePath::name, and JsonTablePath::value.

Referenced by makeJsonTablePathScan().

◆ makeJsonTablePathSpec()

JsonTablePathSpec* makeJsonTablePathSpec ( char *  string,
char *  name,
int  string_location,
int  name_location 
)

Definition at line 955 of file makefuncs.c.

957 {
959 
960  Assert(string != NULL);
961  pathspec->string = makeStringConst(string, string_location);
962  if (name != NULL)
963  pathspec->name = pstrdup(name);
964 
965  pathspec->name_location = name_location;
966  pathspec->location = string_location;
967 
968  return pathspec;
969 }
Node * makeStringConst(char *str, int location)
Definition: makefuncs.c:568
ParseLoc name_location
Definition: parsenodes.h:1813

References Assert, JsonTablePathSpec::location, makeNode, makeStringConst(), name, JsonTablePathSpec::name, JsonTablePathSpec::name_location, pstrdup(), and JsonTablePathSpec::string.

◆ makeJsonValueExpr()

JsonValueExpr* makeJsonValueExpr ( Expr raw_expr,
Expr formatted_expr,
JsonFormat format 
)

Definition at line 888 of file makefuncs.c.

890 {
892 
893  jve->raw_expr = raw_expr;
894  jve->formatted_expr = formatted_expr;
895  jve->format = format;
896 
897  return jve;
898 }
Expr * formatted_expr
Definition: primnodes.h:1684
JsonFormat * format
Definition: primnodes.h:1685
Expr * raw_expr
Definition: primnodes.h:1683

References format, JsonValueExpr::format, JsonValueExpr::formatted_expr, makeNode, and JsonValueExpr::raw_expr.

Referenced by eval_const_expressions_mutator(), transformJsonArrayQueryConstructor(), transformJsonParseArg(), and transformJsonTableColumn().

◆ makeNotNullConstraint()

Constraint* makeNotNullConstraint ( String colname)

Definition at line 444 of file makefuncs.c.

445 {
446  Constraint *notnull;
447 
448  notnull = makeNode(Constraint);
449  notnull->contype = CONSTR_NOTNULL;
450  notnull->conname = NULL;
451  notnull->is_no_inherit = false;
452  notnull->deferrable = false;
453  notnull->initdeferred = false;
454  notnull->location = -1;
455  notnull->keys = list_make1(colname);
456  notnull->skip_validation = false;
457  notnull->initially_valid = true;
458 
459  return notnull;
460 }
@ CONSTR_NOTNULL
Definition: parsenodes.h:2726
bool initdeferred
Definition: parsenodes.h:2759
ParseLoc location
Definition: parsenodes.h:2798
List * keys
Definition: parsenodes.h:2769
ConstrType contype
Definition: parsenodes.h:2756
bool is_no_inherit
Definition: parsenodes.h:2762
bool initially_valid
Definition: parsenodes.h:2761
bool skip_validation
Definition: parsenodes.h:2760
bool deferrable
Definition: parsenodes.h:2758
char * conname
Definition: parsenodes.h:2757

References Constraint::conname, CONSTR_NOTNULL, Constraint::contype, Constraint::deferrable, Constraint::initdeferred, Constraint::initially_valid, Constraint::is_no_inherit, Constraint::keys, list_make1, Constraint::location, makeNode, and Constraint::skip_validation.

Referenced by ATExecSetNotNull(), ATPrepAddPrimaryKey(), transformColumnDefinition(), and transformIndexConstraint().

◆ makeNullConst()

Const* makeNullConst ( Oid  consttype,
int32  consttypmod,
Oid  constcollid 
)

Definition at line 339 of file makefuncs.c.

340 {
341  int16 typLen;
342  bool typByVal;
343 
344  get_typlenbyval(consttype, &typLen, &typByVal);
345  return makeConst(consttype,
346  consttypmod,
347  constcollid,
348  (int) typLen,
349  (Datum) 0,
350  true,
351  typByVal);
352 }
signed short int16
Definition: c.h:507
void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval)
Definition: lsyscache.c:2251
uintptr_t Datum
Definition: postgres.h:64

References get_typlenbyval(), and makeConst().

Referenced by adjust_appendrel_attrs_mutator(), ATExecAddColumn(), build_subplan(), BuildOnConflictExcludedTargetlist(), coerce_record_to_complex(), eval_const_expressions_mutator(), evaluate_function(), ExecInitExprRec(), expandRTE(), expandTupleDesc(), remove_unused_subquery_outputs(), ReplaceVarsFromTargetList_callback(), rewriteValuesRTE(), rewriteValuesRTEToNulls(), set_plan_refs(), and transformAssignedExpr().

◆ makeRangeVar()

RangeVar* makeRangeVar ( char *  schemaname,
char *  relname,
int  location 
)

Definition at line 424 of file makefuncs.c.

425 {
426  RangeVar *r = makeNode(RangeVar);
427 
428  r->catalogname = NULL;
429  r->schemaname = schemaname;
430  r->relname = relname;
431  r->inh = true;
432  r->relpersistence = RELPERSISTENCE_PERMANENT;
433  r->alias = NULL;
434  r->location = location;
435 
436  return r;
437 }
NameData relname
Definition: pg_class.h:38
char * relname
Definition: primnodes.h:82
bool inh
Definition: primnodes.h:85
Alias * alias
Definition: primnodes.h:91
char relpersistence
Definition: primnodes.h:88
char * catalogname
Definition: primnodes.h:76
ParseLoc location
Definition: primnodes.h:94
char * schemaname
Definition: primnodes.h:79

References RangeVar::alias, RangeVar::catalogname, RangeVar::inh, RangeVar::location, makeNode, relname, RangeVar::relname, RangeVar::relpersistence, and RangeVar::schemaname.

Referenced by AlterTableNamespace(), ATParseTransformCmd(), autovacuum_do_vac_analyze(), boot_openrel(), BootstrapToastTable(), DoCopy(), ExpandColumnRefStar(), fetch_table_list(), generateSerialExtraStmts(), logicalrep_rel_open(), LookupTypeNameExtended(), makeRangeVarFromNameList(), plpgsql_parse_cwordtype(), transformAlterTableStmt(), and transformColumnRef().

◆ makeRelabelType()

RelabelType* makeRelabelType ( Expr arg,
Oid  rtype,
int32  rtypmod,
Oid  rcollid,
CoercionForm  rformat 
)

Definition at line 404 of file makefuncs.c.

406 {
408 
409  r->arg = arg;
410  r->resulttype = rtype;
411  r->resulttypmod = rtypmod;
412  r->resultcollid = rcollid;
413  r->relabelformat = rformat;
414  r->location = -1;
415 
416  return r;
417 }
Oid resulttype
Definition: primnodes.h:1185
ParseLoc location
Definition: primnodes.h:1192
Expr * arg
Definition: primnodes.h:1184

References arg, RelabelType::arg, RelabelType::location, makeNode, and RelabelType::resulttype.

Referenced by assign_hypothetical_collations(), buildMergedJoinVar(), coerce_type(), and make_partition_op_expr().

◆ makeSimpleA_Expr()

A_Expr* makeSimpleA_Expr ( A_Expr_Kind  kind,
char *  name,
Node lexpr,
Node rexpr,
int  location 
)

Definition at line 48 of file makefuncs.c.

50 {
51  A_Expr *a = makeNode(A_Expr);
52 
53  a->kind = kind;
54  a->name = list_make1(makeString((char *) name));
55  a->lexpr = lexpr;
56  a->rexpr = rexpr;
57  a->location = location;
58  return a;
59 }
String * makeString(char *str)
Definition: value.c:63

References a, list_make1, makeNode, makeString(), and name.

Referenced by test_rls_hooks_permissive(), test_rls_hooks_restrictive(), transformAExprBetween(), transformCaseExpr(), and transformJoinUsingClause().

◆ makeStringConst()

Node* makeStringConst ( char *  str,
int  location 
)

Definition at line 568 of file makefuncs.c.

569 {
570  A_Const *n = makeNode(A_Const);
571 
572  n->val.sval.type = T_String;
573  n->val.sval.sval = str;
574  n->location = location;
575 
576  return (Node *) n;
577 }
const char * str
union ValUnion val
Definition: parsenodes.h:364
ParseLoc location
Definition: parsenodes.h:366
char * sval
Definition: value.h:68
String sval
Definition: parsenodes.h:355

References A_Const::location, makeNode, str, ValUnion::sval, String::sval, and A_Const::val.

Referenced by makeJsonTablePathSpec(), and transformJsonTableColumn().

◆ makeTargetEntry()

TargetEntry* makeTargetEntry ( Expr expr,
AttrNumber  resno,
char *  resname,
bool  resjunk 
)

Definition at line 240 of file makefuncs.c.

244 {
246 
247  tle->expr = expr;
248  tle->resno = resno;
249  tle->resname = resname;
250 
251  /*
252  * We always set these fields to 0. If the caller wants to change them he
253  * must do so explicitly. Few callers do that, so omitting these
254  * arguments reduces the chance of error.
255  */
256  tle->ressortgroupref = 0;
257  tle->resorigtbl = InvalidOid;
258  tle->resorigcol = 0;
259 
260  tle->resjunk = resjunk;
261 
262  return tle;
263 }
Expr * expr
Definition: primnodes.h:2190
AttrNumber resno
Definition: primnodes.h:2192
Index ressortgroupref
Definition: primnodes.h:2196

References TargetEntry::expr, InvalidOid, makeNode, TargetEntry::resno, and TargetEntry::ressortgroupref.

Referenced by add_row_identity_var(), add_to_flat_tlist(), ApplyRetrieveRule(), build_index_tlist(), build_minmax_path(), build_path_tlist(), build_physical_tlist(), build_remote_returning(), BuildOnConflictExcludedTargetlist(), check_sql_fn_retval(), coerce_fn_result_column(), convert_combining_aggrefs(), convert_EXISTS_to_ANY(), create_unique_plan(), determineRecursiveColTypes(), ExecInitSubPlan(), expand_inherited_rtentry(), expand_insert_targetlist(), expandNSItemAttrs(), ExpandRowReference(), foreign_grouping_ok(), generate_append_tlist(), generate_setop_tlist(), make_tlist_from_pathtarget(), prepare_sort_from_pathkeys(), preprocess_targetlist(), pull_up_constant_function(), pull_up_simple_values(), rebuild_fdw_scan_tlist(), rewriteSearchAndCycle(), rewriteTargetListIU(), transformAggregateCall(), transformMergeStmt(), transformMultiAssignRef(), transformReturnStmt(), transformSetOperationStmt(), transformSetOperationTree(), and transformTargetEntry().

◆ makeTypeName()

TypeName* makeTypeName ( char *  typnam)

Definition at line 469 of file makefuncs.c.

470 {
472 }
TypeName * makeTypeNameFromNameList(List *names)
Definition: makefuncs.c:481

References list_make1, makeString(), and makeTypeNameFromNameList().

Referenced by plpgsql_parse_wordrowtype().

◆ makeTypeNameFromNameList()

◆ makeTypeNameFromOid()

TypeName* makeTypeNameFromOid ( Oid  typeOid,
int32  typmod 
)

Definition at line 497 of file makefuncs.c.

498 {
499  TypeName *n = makeNode(TypeName);
500 
501  n->typeOid = typeOid;
502  n->typemod = typmod;
503  n->location = -1;
504  return n;
505 }
Oid typeOid
Definition: parsenodes.h:271

References TypeName::location, makeNode, TypeName::typemod, and TypeName::typeOid.

Referenced by generateSerialExtraStmts(), makeColumnDef(), and transformAlterTableStmt().

◆ makeVacuumRelation()

VacuumRelation* makeVacuumRelation ( RangeVar relation,
Oid  oid,
List va_cols 
)

Definition at line 857 of file makefuncs.c.

858 {
860 
861  v->relation = relation;
862  v->oid = oid;
863  v->va_cols = va_cols;
864  return v;
865 }
RangeVar * relation
Definition: parsenodes.h:3883

References makeNode, VacuumRelation::oid, VacuumRelation::relation, and VacuumRelation::va_cols.

Referenced by autovacuum_do_vac_analyze(), expand_vacuum_rel(), and get_all_vacuum_rels().

◆ makeVar()

Var* makeVar ( int  varno,
AttrNumber  varattno,
Oid  vartype,
int32  vartypmod,
Oid  varcollid,
Index  varlevelsup 
)

Definition at line 66 of file makefuncs.c.

72 {
73  Var *var = makeNode(Var);
74 
75  var->varno = varno;
76  var->varattno = varattno;
77  var->vartype = vartype;
78  var->vartypmod = vartypmod;
79  var->varcollid = varcollid;
80  var->varlevelsup = varlevelsup;
81 
82  /*
83  * Only a few callers need to make Var nodes with non-null varnullingrels,
84  * or with varnosyn/varattnosyn different from varno/varattno. We don't
85  * provide separate arguments for them, but just initialize them to NULL
86  * and the given varno/varattno. This reduces code clutter and chance of
87  * error for most callers.
88  */
89  var->varnullingrels = NULL;
90  var->varnosyn = (Index) varno;
91  var->varattnosyn = varattno;
92 
93  /* Likewise, we just set location to "unknown" here */
94  var->location = -1;
95 
96  return var;
97 }
unsigned int Index
Definition: c.h:619
Definition: primnodes.h:248
ParseLoc location
Definition: primnodes.h:293
AttrNumber varattno
Definition: primnodes.h:260
int varno
Definition: primnodes.h:255
Index varlevelsup
Definition: primnodes.h:280

References Var::location, makeNode, Var::varattno, Var::varlevelsup, and Var::varno.

Referenced by add_row_identity_columns(), ATPrepAlterColumnType(), build_index_tlist(), build_physical_tlist(), build_remote_returning(), buildGroupedVar(), BuildOnConflictExcludedTargetlist(), buildVarFromNSColumn(), eval_const_expressions_mutator(), expand_inherited_rtentry(), expand_single_inheritance_child(), expandNSItemVars(), expandRTE(), expandTupleDesc(), fix_indexqual_operand(), generate_append_tlist(), generate_setop_tlist(), get_qual_for_hash(), get_qual_for_list(), get_range_key_properties(), get_range_nulltest(), get_relation_constraints(), make_inh_translation_list(), make_path_cat_expr(), make_path_rowexpr(), makeVarFromTargetEntry(), makeWholeRowVar(), NotNullImpliedByRelConstraints(), PartConstraintImpliedByRelConstraint(), postgresAddForeignUpdateTargets(), preprocess_targetlist(), rewriteSearchAndCycle(), scanNSItemForColumn(), set_baserel_partition_key_exprs(), set_dummy_tlist_references(), transformAssignedExpr(), and transformSetOperationStmt().

◆ makeVarFromTargetEntry()

Var* makeVarFromTargetEntry ( int  varno,
TargetEntry tle 
)

Definition at line 105 of file makefuncs.c.

107 {
108  return makeVar(varno,
109  tle->resno,
110  exprType((Node *) tle->expr),
111  exprTypmod((Node *) tle->expr),
112  exprCollation((Node *) tle->expr),
113  0);
114 }
Var * makeVar(int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Definition: makefuncs.c:66
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:42
int32 exprTypmod(const Node *expr)
Definition: nodeFuncs.c:298
Oid exprCollation(const Node *expr)
Definition: nodeFuncs.c:816

References TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), makeVar(), and TargetEntry::resno.

Referenced by build_physical_tlist(), coerce_fn_result_column(), generate_subquery_vars(), make_setop_translation_list(), search_indexed_tlist_for_non_var(), search_indexed_tlist_for_phv(), search_indexed_tlist_for_sortgroupref(), and transformInsertStmt().

◆ makeWholeRowVar()

Var* makeWholeRowVar ( RangeTblEntry rte,
int  varno,
Index  varlevelsup,
bool  allowScalar 
)

Definition at line 135 of file makefuncs.c.

139 {
140  Var *result;
141  Oid toid;
142  Node *fexpr;
143 
144  switch (rte->rtekind)
145  {
146  case RTE_RELATION:
147  /* relation: the rowtype is a named composite type */
148  toid = get_rel_type_id(rte->relid);
149  if (!OidIsValid(toid))
150  ereport(ERROR,
151  (errcode(ERRCODE_WRONG_OBJECT_TYPE),
152  errmsg("relation \"%s\" does not have a composite type",
153  get_rel_name(rte->relid))));
154  result = makeVar(varno,
156  toid,
157  -1,
158  InvalidOid,
159  varlevelsup);
160  break;
161 
162  case RTE_FUNCTION:
163 
164  /*
165  * If there's more than one function, or ordinality is requested,
166  * force a RECORD result, since there's certainly more than one
167  * column involved and it can't be a known named type.
168  */
169  if (rte->funcordinality || list_length(rte->functions) != 1)
170  {
171  /* always produces an anonymous RECORD result */
172  result = makeVar(varno,
174  RECORDOID,
175  -1,
176  InvalidOid,
177  varlevelsup);
178  break;
179  }
180 
181  fexpr = ((RangeTblFunction *) linitial(rte->functions))->funcexpr;
182  toid = exprType(fexpr);
183  if (type_is_rowtype(toid))
184  {
185  /* func returns composite; same as relation case */
186  result = makeVar(varno,
188  toid,
189  -1,
190  InvalidOid,
191  varlevelsup);
192  }
193  else if (allowScalar)
194  {
195  /* func returns scalar; just return its output as-is */
196  result = makeVar(varno,
197  1,
198  toid,
199  -1,
200  exprCollation(fexpr),
201  varlevelsup);
202  }
203  else
204  {
205  /* func returns scalar, but we want a composite result */
206  result = makeVar(varno,
208  RECORDOID,
209  -1,
210  InvalidOid,
211  varlevelsup);
212  }
213  break;
214 
215  default:
216 
217  /*
218  * RTE is a join, subselect, tablefunc, or VALUES. We represent
219  * this as a whole-row Var of RECORD type. (Note that in most
220  * cases the Var will be expanded to a RowExpr during planning,
221  * but that is not our concern here.)
222  */
223  result = makeVar(varno,
225  RECORDOID,
226  -1,
227  InvalidOid,
228  varlevelsup);
229  break;
230  }
231 
232  return result;
233 }
#define InvalidAttrNumber
Definition: attnum.h:23
#define OidIsValid(objectId)
Definition: c.h:780
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
bool type_is_rowtype(Oid typid)
Definition: lsyscache.c:2655
Oid get_rel_type_id(Oid relid)
Definition: lsyscache.c:1979
char * get_rel_name(Oid relid)
Definition: lsyscache.c:1928
@ RTE_FUNCTION
Definition: parsenodes.h:1020
@ RTE_RELATION
Definition: parsenodes.h:1017
unsigned int Oid
Definition: postgres_ext.h:31
bool funcordinality
Definition: parsenodes.h:1179
List * functions
Definition: parsenodes.h:1177
RTEKind rtekind
Definition: parsenodes.h:1047

References ereport, errcode(), errmsg(), ERROR, exprCollation(), exprType(), RangeTblEntry::funcordinality, RangeTblEntry::functions, get_rel_name(), get_rel_type_id(), InvalidAttrNumber, InvalidOid, linitial, list_length(), makeVar(), OidIsValid, RangeTblEntry::relid, RTE_FUNCTION, RTE_RELATION, RangeTblEntry::rtekind, and type_is_rowtype().

Referenced by ApplyRetrieveRule(), expand_inherited_rtentry(), preprocess_targetlist(), transform_MERGE_to_join(), and transformWholeRowRef().