/* *Alias- *specifiesanaliasforarangevariable;thealiasmightalso *specifyrenamingofcolumnswithinthetable. * *Note:colnamesisalistofStringnodes.InAliasstructs *associatedwithRTEs,theremaybeentriescorrespondingtodropped *columns;thesearenormallyemptystrings("").Seeparsenodes.hforinfo.
*/ typedefstruct Alias
{
NodeTag type; char *aliasname; /* aliased rel name (never qualified) */
List *colnames; /* optional list of column aliases */
} Alias;
/* What to do at commit time for temporary relations */ typedefenum OnCommitAction
{
ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
ONCOMMIT_DROP, /* ON COMMIT DROP */
} OnCommitAction;
/* *TableFunc-nodeforatablefunction,suchasXMLTABLEandJSON_TABLE. * *Entriesinthens_nameslistareeitherStringnodescontaining *literalnamespacenames,orNULLpointerstorepresentDEFAULT.
*/ typedefstruct TableFunc
{
NodeTag type; /* XMLTABLE or JSON_TABLE */
TableFuncType functype; /* list of namespace URI expressions */
List *ns_uris pg_node_attr(query_jumble_ignore); /* list of namespace names or NULL */
List *ns_names pg_node_attr(query_jumble_ignore); /* input document expression */
Node *docexpr; /* row filter expression */
Node *rowexpr; /* column names (list of String) */
List *colnames pg_node_attr(query_jumble_ignore); /* OID list of column type OIDs */
List *coltypes pg_node_attr(query_jumble_ignore); /* integer list of column typmods */
List *coltypmods pg_node_attr(query_jumble_ignore); /* OID list of column collation OIDs */
List *colcollations pg_node_attr(query_jumble_ignore); /* list of column filter expressions */
List *colexprs; /* list of column default expressions */
List *coldefexprs pg_node_attr(query_jumble_ignore); /* JSON_TABLE: list of column value expressions */
List *colvalexprs pg_node_attr(query_jumble_ignore); /* JSON_TABLE: list of PASSING argument expressions */
List *passingvalexprs pg_node_attr(query_jumble_ignore); /* nullability flag for each output column */
Bitmapset *notnulls pg_node_attr(query_jumble_ignore); /* JSON_TABLE plan */
Node *plan pg_node_attr(query_jumble_ignore); /* counts from 0; -1 if none specified */ int ordinalitycol pg_node_attr(query_jumble_ignore); /* token location, or -1 if unknown */
ParseLoc location;
} TableFunc;
RangeVar *rel; /* target relation name */
List *colNames; /* column names to assign, or NIL */ char *accessMethod; /* table access method */
List *options; /* options from WITH clause */
OnCommitAction onCommit; /* what do we do at COMMIT? */ char *tableSpaceName; /* table space to use, or NULL */ /* materialized view's SELECT query */ struct Query *viewQuery pg_node_attr(query_jumble_ignore); bool skipData; /* true for WITH NO DATA */
} IntoClause;
/* Symbols for the indexes of the special RTE entries in rules */ #define PRS2_OLD_VARNO 1 #define PRS2_NEW_VARNO 2
/* Returning behavior for Vars in RETURNING list */ typedefenum VarReturningType
{
VAR_RETURNING_DEFAULT, /* return OLD for DELETE, else return NEW */
VAR_RETURNING_OLD, /* return OLD for DELETE/UPDATE, else NULL */
VAR_RETURNING_NEW, /* return NEW for INSERT/UPDATE, else NULL */
} VarReturningType;
typedefstruct Var
{
Expr xpr;
/* *indexofthisvar'srelationintherangetable,or *INNER_VAR/OUTER_VAR/etc
*/ int varno;
/* pg_type OID for the type of this var */
Oid vartype pg_node_attr(query_jumble_ignore); /* pg_attribute typmod value */
int32 vartypmod pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid varcollid pg_node_attr(query_jumble_ignore);
Expr xpr; /* pg_type OID of the constant's datatype */
Oid consttype; /* typmod value, if any */
int32 consttypmod pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid constcollid pg_node_attr(query_jumble_ignore); /* typlen of the constant's datatype */ int constlen pg_node_attr(query_jumble_ignore); /* the constant's value */
Datum constvalue pg_node_attr(query_jumble_ignore); /* whether the constant is null (if true, constvalue is undefined) */ bool constisnull pg_node_attr(query_jumble_ignore);
Expr xpr;
ParamKind paramkind; /* kind of parameter. See above */ int paramid; /* numeric ID for parameter */
Oid paramtype; /* pg_type OID of parameter's datatype */ /* typmod value, if known */
int32 paramtypmod; /* OID of collation, or InvalidOid if none */
Oid paramcollid; /* token location, or -1 if unknown */
ParseLoc location;
} Param;
/* *WindowFunc * *Collationinformationisirrelevantforthequeryjumbling,asisthe *internalstateinformationofthenodelike"winstar"and"winagg".
*/ typedefstruct WindowFunc
{
Expr xpr; /* pg_proc Oid of the function */
Oid winfnoid; /* type Oid of result of the window function */
Oid wintype pg_node_attr(query_jumble_ignore); /* OID of collation of result */
Oid wincollid pg_node_attr(query_jumble_ignore); /* OID of collation that function should use */
Oid inputcollid pg_node_attr(query_jumble_ignore); /* arguments to the window function */
List *args; /* FILTER expression, if any */
Expr *aggfilter; /* List of WindowFuncRunConditions to help short-circuit execution */
List *runCondition pg_node_attr(query_jumble_ignore); /* index of associated WindowClause */
Index winref; /* true if argument list was really '*' */ bool winstar pg_node_attr(query_jumble_ignore); /* is function a simple aggregate? */ bool winagg pg_node_attr(query_jumble_ignore); /* token location, or -1 if unknown */
ParseLoc location;
} WindowFunc;
/* *MergeSupportFunc * *AMergeSupportFuncisamergesupportfunctionexpressionthatcanonly *appearintheRETURNINGlistofaMERGEcommand.Itreturnsinformation *aboutthecurrentlyexecutingmergeaction. * *Currently,theonlysupportedfunctionisMERGE_ACTION(),whichreturnsthe *commandexecuted("INSERT","UPDATE",or"DELETE").
*/ typedefstruct MergeSupportFunc
{
Expr xpr; /* type Oid of result */
Oid msftype; /* OID of collation, or InvalidOid if none */
Oid msfcollid; /* token location, or -1 if unknown */
ParseLoc location;
} MergeSupportFunc;
/* *SubscriptingRef:describesasubscriptingoperationoveracontainer *(array,etc). * *ASubscriptingRefcandescribefetchingasingleelementfromacontainer, *fetchingapartofacontainer(e.g.anarrayslice),storingasingle *elementintoacontainer,orstoringaslice.The"store"casesworkwith *aninitialcontainervalueandasourcevaluethatisinsertedintothe *appropriatepartofthecontainer;theresultoftheoperationisan *entirenewmodifiedcontainervalue. * *Ifreflowerindexpr=NIL,thenwearefetchingorstoringasinglecontainer *elementatthesubscriptsgivenbyrefupperindexpr.Otherwiseweare *fetchingorstoringacontainerslice,thatisarectangularsubcontainer *withlowerandupperboundsgivenbytheindexexpressions. *reflowerindexprmustbethesamelengthasrefupperindexprwhenit *isnotNIL. * *Intheslicecase,individualexpressionsinthesubscriptlistscanbe *NULL,meaning"substitutethearray'scurrentlowerorupperbound". *(Non-arraycontainersmayormaynotsupportthis.) * *refcontainertypeistheactualcontainertypethatdeterminesthe *subscriptingsemantics.(Thiswillgenerallybeeithertheexposedtypeof *refexpr,orthebasetypeifthatisadomain.)refelemtypeisthetypeof *thecontainer'selements;thisissavedfortheuseofthesubscripting *functions,butisnotusedbythecorecode.refrestype,reftypmod,and *refcolliddescribethetypeoftheSubscriptingRef'sresult.Inastore *expression,refrestypewillalwaysmatchrefcontainertype;inafetch, *itcouldberefelemtypeforanelementfetch,orrefcontainertypefora *slicefetch,orpossiblysomethingelseasdeterminedbytype-specific *subscriptinglogic.Likewise,reftypmodandrefcollidwillmatchthe *container'spropertiesinastore,butcouldbedifferentinafetch. * *Anyinternalstatedataisignoredforthequeryjumbling. * *Note:forthecaseswhereacontainerisreturned,ifrefexpryieldsaR/W *expandedcontainer,thentheimplementationisallowedtomodifythat *objectin-placeandreturnthesameobject.
*/ typedefstruct SubscriptingRef
{
Expr xpr; /* type of the container proper */
Oid refcontainertype pg_node_attr(query_jumble_ignore); /* the container type's pg_type.typelem */
Oid refelemtype pg_node_attr(query_jumble_ignore); /* type of the SubscriptingRef's result */
Oid refrestype pg_node_attr(query_jumble_ignore); /* typmod of the result */
int32 reftypmod pg_node_attr(query_jumble_ignore); /* collation of result, or InvalidOid if none */
Oid refcollid pg_node_attr(query_jumble_ignore); /* expressions that evaluate to upper container indexes */
List *refupperindexpr;
/* *expressionsthatevaluatetolowercontainerindexes,orNILforsingle *containerelement.
*/
List *reflowerindexpr; /* the expression that evaluates to a container value */
Expr *refexpr; /* expression for the source value, or NULL if fetch */
Expr *refassgnexpr;
} SubscriptingRef;
/* *CoercionContext-distinguishestheallowedsetoftypecasts * *NB:orderingofthealternativesissignificant;later(larger)values *allowmorecaststhanearlierones.
*/ typedefenum CoercionContext
{
COERCION_IMPLICIT, /* coercion in context of expression */
COERCION_ASSIGNMENT, /* coercion in context of assignment */
COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
COERCION_EXPLICIT, /* explicit cast operation */
} CoercionContext;
/* *CoercionForm-howtodisplayaFuncExprorrelatednode * *"Coercion"isabitofamisnomer,sincethisvaluerecordsother *specialsyntaxesbesidescasts,butfornowwe'llkeepthisnaming. * *NB:equal()ignoresCoercionFormfields,thereforethis*must*notcarry *anysemanticallysignificantinformation.Weneedthatbehaviorsothat *theplannerwillconsiderequivalentimplicitandexplicitcaststobe *equivalent.Incaseswherethoseactuallybehavedifferently,thecoercion *function'sargumentswillbedifferent.
*/ typedefenum CoercionForm
{
COERCE_EXPLICIT_CALL, /* display as a function call */
COERCE_EXPLICIT_CAST, /* display as an explicit cast */
COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
COERCE_SQL_SYNTAX, /* display with SQL-mandated special syntax */
} CoercionForm;
/* *FuncExpr-expressionnodeforafunctioncall * *Collationinformationisirrelevantforthequeryjumbling,onlythe *argumentsandthefunctionOIDmatter.
*/ typedefstruct FuncExpr
{
Expr xpr; /* PG_PROC OID of the function */
Oid funcid; /* PG_TYPE OID of result value */
Oid funcresulttype pg_node_attr(query_jumble_ignore); /* true if function returns set */ bool funcretset pg_node_attr(query_jumble_ignore);
/* *trueifvariadicargumentshavebeencombinedintoanarraylast *argument
*/ bool funcvariadic pg_node_attr(query_jumble_ignore); /* how to display this function call */
CoercionForm funcformat pg_node_attr(query_jumble_ignore); /* OID of collation of result */
Oid funccollid pg_node_attr(query_jumble_ignore); /* OID of collation that function should use */
Oid inputcollid pg_node_attr(query_jumble_ignore); /* arguments to the function */
List *args; /* token location, or -1 if unknown */
ParseLoc location;
} FuncExpr;
/* *NamedArgExpr-anamedargumentofafunction * *ThisnodetypecanonlyappearintheargslistofaFuncCallorFuncExpr *node.Wesupportpurepositionalcallnotation(nonamedarguments), *namednotation(allargumentsarenamed),andmixednotation(unnamed *argumentsfollowedbynamedones). * *Parseanalysissetsargnumbertothepositionalindexoftheargument, *butdoesn'trearrangetheargumentlist. * *Theplannerwillconvertargumentliststopurepositionalnotation *duringexpressionpreprocessing,soexecutionneverseesaNamedArgExpr.
*/ typedefstruct NamedArgExpr
{
Expr xpr; /* the argument expression */
Expr *arg; /* the name */ char *name pg_node_attr(query_jumble_ignore); /* argument's number in positional notation */ int argnumber; /* argument name location, or -1 if unknown */
ParseLoc location;
} NamedArgExpr;
typedefstruct SubLink
{
Expr xpr;
SubLinkType subLinkType; /* see above */ int subLinkId; /* ID (1..n); 0 if not MULTIEXPR */
Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */ /* originally specified operator name */
List *operName pg_node_attr(query_jumble_ignore); /* subselect as Query* or raw parsetree */
Node *subselect;
ParseLoc location; /* token location, or -1 if unknown */
} SubLink;
Expr xpr; /* Fields copied from original SubLink: */
SubLinkType subLinkType; /* see above */ /* The combining operators, transformed to an executable expression: */
Node *testexpr; /* OpExpr or RowCompareExpr expression tree */
List *paramIds; /* IDs of Params embedded in the above */ /* Identification of the Plan tree to use: */ int plan_id; /* Index (from 1) in PlannedStmt.subplans */ /* Identification of the SubPlan for EXPLAIN and debugging purposes: */ char *plan_name; /* A name assigned during planning */ /* Extra data useful for determining subplan's output type: */
Oid firstColType; /* Type of first column of subplan result */
int32 firstColTypmod; /* Typmod of first column of subplan result */
Oid firstColCollation; /* Collation of first column of subplan
* result */ /* Information about execution strategy: */ bool useHashTable; /* true to store subselect output in a hash
* table (implies we are doing "IN") */ bool unknownEqFalse; /* true if it's okay to return FALSE when the *specresultisUNKNOWN;thisallowsmuch
* simpler handling of null values */ bool parallel_safe; /* is the subplan parallel-safe? */ /* Note: parallel_safe does not consider contents of testexpr or args */ /* Information for passing params into and out of the subselect: */ /* setParam and parParam are lists of integers (param IDs) */
List *setParam; /* initplan and MULTIEXPR subqueries have to
* set these Params for parent plan */
List *parParam; /* indices of input Params from parent plan */
List *args; /* exprs to pass as parParam values */ /* Estimated execution costs: */
Cost startup_cost; /* one-time setup cost */
Cost per_call_cost; /* cost for each subplan evaluation */
} SubPlan;
typedefstruct FieldSelect
{
Expr xpr;
Expr *arg; /* input expression */
AttrNumber fieldnum; /* attribute number of field to extract */ /* type of the field (result type of this node) */
Oid resulttype pg_node_attr(query_jumble_ignore); /* output typmod (usually -1) */
int32 resulttypmod pg_node_attr(query_jumble_ignore); /* OID of collation of the field */
Oid resultcollid pg_node_attr(query_jumble_ignore);
} FieldSelect;
typedefstruct FieldStore
{
Expr xpr;
Expr *arg; /* input tuple value */
List *newvals; /* new value(s) for field(s) */ /* integer list of field attnums */
List *fieldnums pg_node_attr(query_jumble_ignore); /* type of result (same as type of arg) */
Oid resulttype pg_node_attr(query_jumble_ignore); /* Like RowExpr, we deliberately omit a typmod and collation here */
} FieldStore;
typedefstruct RelabelType
{
Expr xpr;
Expr *arg; /* input expression */
Oid resulttype; /* output type of coercion expression */ /* output typmod (usually -1) */
int32 resulttypmod pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid resultcollid pg_node_attr(query_jumble_ignore); /* how to display this node */
CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */
} RelabelType;
typedefstruct CoerceViaIO
{
Expr xpr;
Expr *arg; /* input expression */
Oid resulttype; /* output type of coercion */ /* output typmod is not stored, but is presumed -1 */ /* OID of collation, or InvalidOid if none */
Oid resultcollid pg_node_attr(query_jumble_ignore); /* how to display this node */
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */
} CoerceViaIO;
typedefstruct ArrayCoerceExpr
{
Expr xpr;
Expr *arg; /* input expression (yields an array) */
Expr *elemexpr; /* expression representing per-element work */
Oid resulttype; /* output type of coercion (an array type) */ /* output typmod (also element typmod) */
int32 resulttypmod pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid resultcollid pg_node_attr(query_jumble_ignore); /* how to display this node */
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */
} ArrayCoerceExpr;
typedefstruct ConvertRowtypeExpr
{
Expr xpr;
Expr *arg; /* input expression */
Oid resulttype; /* output type (always a composite type) */ /* Like RowExpr, we deliberately omit a typmod and collation here */ /* how to display this node */
CoercionForm convertformat pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */
} ConvertRowtypeExpr;
/*---------- *CollateExpr-COLLATE * *TheplannerreplacesCollateExprwithRelabelTypeduringexpression *preprocessing,soexecutionneverseesaCollateExpr. *----------
*/ typedefstruct CollateExpr
{
Expr xpr;
Expr *arg; /* input expression */
Oid collOid; /* collation's OID */
ParseLoc location; /* token location, or -1 if unknown */
} CollateExpr;
/*---------- *CaseExpr-aCASEexpression * *WesupporttwodistinctformsofCASEexpression: *CASEWHENboolexprTHENexpr[WHENboolexprTHENexpr...] *CASEtestexprWHENcompexprTHENexpr[WHENcompexprTHENexpr...] *Thesearedistinguishablebythe"arg"fieldbeingNULLinthefirstcase *andthetestexprinthesecondcase. * *Intherawgrammaroutputforthesecondform,theconditionexpressions *oftheWHENclausesarejustthecomparisonvalues.Parseanalysis *convertsthesetovalidbooleanexpressionsoftheform *CaseTestExpr'='compexpr *wheretheCaseTestExprnodeisaplaceholderthatemitsthecorrect *valueatruntime.Thisstructureisusedsothatthetestexprneedbe *evaluatedonlyonce.Notethatafterparseanalysis,thecondition *expressionsalwaysyieldboolean. * *Note:wecantestwhetheraCaseExprhasbeenthroughparseanalysis *yetbycheckingwhethercasetypeisInvalidOidornot. *----------
*/ typedefstruct CaseExpr
{
Expr xpr; /* type of expression result */
Oid casetype pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid casecollid pg_node_attr(query_jumble_ignore);
Expr *arg; /* implicit equality comparison argument */
List *args; /* the arguments (list of WHEN clauses) */
Expr *defresult; /* the default result (ELSE clause) */
ParseLoc location; /* token location, or -1 if unknown */
} CaseExpr;
/* *PlaceholdernodeforthetestvaluetobeprocessedbyaCASEexpression. *ThisiseffectivelylikeaParam,butcanbeimplementedmoresimply *sinceweneedonlyonereplacementvalueatatime. * *Wealsoabusethisnodetypeforsomeotherpurposes,including: **PlaceholderforthecurrentarrayelementvalueinArrayCoerceExpr; *seebuild_coercion_expression(). **NestedFieldStore/SubscriptingRefassignmentexpressionsinINSERT/UPDATE; *seetransformAssignmentIndirection(). **PlaceholderforintermediateresultsinsomeSQL/JSONexpressionnodes, *suchasJsonConstructorExpr. * *TheusesinCaseExprandArrayCoerceExpraresafeonlytotheextentthat *thereisnotanyotherCaseExprorArrayCoerceExprbetweenthevaluesource *nodeanditschildCaseTestExpr(s).Thisistrueintheparseanalysis *output,buttheplanner'sfunction-inlininglogichastobecarefulnotto *breakit. * *Thenested-assignment-expressioncaseissafebecausetheonlynodetypes *thatcanbeabovesuchCaseTestExprsareFieldStoreandSubscriptingRef.
*/ typedefstruct CaseTestExpr
{
Expr xpr;
Oid typeId; /* type for substituted value */ /* typemod for substituted value */
int32 typeMod pg_node_attr(query_jumble_ignore); /* collation for the substituted value */
Oid collation pg_node_attr(query_jumble_ignore);
} CaseTestExpr;
/* *ArrayExpr-anARRAY[]expression * *Note:ifmultidimsisfalse,theconstituentexpressionsallyieldthe *scalartypeidentifiedbyelement_typeid.Ifmultidimsistrue,the *constituentexpressionsallyieldarraysofelement_typeid(ie,thesame *typeasarray_typeid);atruntimewemustcheckforcompatiblesubscripts.
*/ typedefstruct ArrayExpr
{
Expr xpr; /* type of expression result */
Oid array_typeid pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid array_collid pg_node_attr(query_jumble_ignore); /* common type of array elements */
Oid element_typeid pg_node_attr(query_jumble_ignore); /* the array elements or sub-arrays */
List *elements pg_node_attr(query_jumble_squash); /* true if elements are sub-arrays */ bool multidims pg_node_attr(query_jumble_ignore); /* location of the start of the elements list */
ParseLoc list_start; /* location of the end of the elements list */
ParseLoc list_end; /* token location, or -1 if unknown */
ParseLoc location;
} ArrayExpr;
/* LT LE GE or GT, never EQ or NE */
CompareType cmptype; /* OID list of pairwise comparison ops */
List *opnos pg_node_attr(query_jumble_ignore); /* OID list of containing operator families */
List *opfamilies pg_node_attr(query_jumble_ignore); /* OID list of collations for comparisons */
List *inputcollids pg_node_attr(query_jumble_ignore); /* the left-hand input arguments */
List *largs; /* the right-hand input arguments */
List *rargs;
} RowCompareExpr;
/* *CoalesceExpr-aCOALESCEexpression
*/ typedefstruct CoalesceExpr
{
Expr xpr; /* type of expression result */
Oid coalescetype pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid coalescecollid pg_node_attr(query_jumble_ignore); /* the arguments */
List *args; /* token location, or -1 if unknown */
ParseLoc location;
} CoalesceExpr;
typedefstruct MinMaxExpr
{
Expr xpr; /* common type of arguments and result */
Oid minmaxtype pg_node_attr(query_jumble_ignore); /* OID of collation of result */
Oid minmaxcollid pg_node_attr(query_jumble_ignore); /* OID of collation that function should use */
Oid inputcollid pg_node_attr(query_jumble_ignore); /* function to execute */
MinMaxOp op; /* the arguments */
List *args; /* token location, or -1 if unknown */
ParseLoc location;
} MinMaxExpr;
typedefstruct XmlExpr
{
Expr xpr; /* xml function ID */
XmlExprOp op; /* name in xml(NAME foo ...) syntaxes */ char *name pg_node_attr(query_jumble_ignore); /* non-XML expressions for xml_attributes */
List *named_args; /* parallel list of String values */
List *arg_names pg_node_attr(query_jumble_ignore); /* list of expressions */
List *args; /* DOCUMENT or CONTENT */
XmlOptionType xmloption pg_node_attr(query_jumble_ignore); /* INDENT option for XMLSERIALIZE */ bool indent; /* target type/typmod for XMLSERIALIZE */
Oid type pg_node_attr(query_jumble_ignore);
int32 typmod pg_node_attr(query_jumble_ignore); /* token location, or -1 if unknown */
ParseLoc location;
} XmlExpr;
typedefstruct MergeAction
{
NodeTag type;
MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */ /* OVERRIDING clause */
OverridingKind override pg_node_attr(query_jumble_ignore);
Node *qual; /* transformed WHEN conditions */
List *targetList; /* the target list (of TargetEntry) */ /* target attribute numbers of an UPDATE */
List *updateColnos pg_node_attr(query_jumble_ignore);
} MergeAction;
/* *CoerceToDomain * *CoerceToDomainrepresentstheoperationofcoercingavaluetoadomain *type.Atruntime(andnotbefore)theprecisesetofconstraintstobe *checkedwillbedetermined.Ifthevaluepasses,itisreturnedasthe *result;ifnot,anerrorisraised.Notethatthisisequivalentto *RelabelTypeinthescenariowherenoconstraintsareapplied.
*/ typedefstruct CoerceToDomain
{
Expr xpr;
Expr *arg; /* input expression */
Oid resulttype; /* domain type ID (result type) */ /* output typmod (currently always -1) */
int32 resulttypmod pg_node_attr(query_jumble_ignore); /* OID of collation, or InvalidOid if none */
Oid resultcollid pg_node_attr(query_jumble_ignore); /* how to display this node */
CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */
} CoerceToDomain;
/* *Placeholdernodeforthevaluetobeprocessedbyadomain'scheck *constraint.ThisiseffectivelylikeaParam,butcanbeimplementedmore *simplysinceweneedonlyonereplacementvalueatatime. * *Note:thetypeId/typeMod/collationwillbesetfromthedomain'sbasetype, *notthedomainitself.Thisisbecauseweshouldn'tconsiderthevalue *tobeamemberofthedomainifwehaven'tyetcheckeditsconstraints.
*/ typedefstruct CoerceToDomainValue
{
Expr xpr; /* type for substituted value */
Oid typeId; /* typemod for substituted value */
int32 typeMod pg_node_attr(query_jumble_ignore); /* collation for the substituted value */
Oid collation pg_node_attr(query_jumble_ignore); /* token location, or -1 if unknown */
ParseLoc location;
} CoerceToDomainValue;
/* *PlaceholdernodeforaDEFAULTmarkerinanINSERTorUPDATEcommand. * *Thisisnotanexecutableexpression:itmustbereplacedbytheactual *columndefaultexpressionduringrewriting.Butitisconvenientto *treatitasanexpressionnodeduringparsingandrewriting.
*/ typedefstruct SetToDefault
{
Expr xpr; /* type for substituted value */
Oid typeId; /* typemod for substituted value */
int32 typeMod pg_node_attr(query_jumble_ignore); /* collation for the substituted value */
Oid collation pg_node_attr(query_jumble_ignore); /* token location, or -1 if unknown */
ParseLoc location;
} SetToDefault;
/* *Noderepresenting[WHERE]CURRENTOFcursor_name * *CURRENTOFisabitlikeaVar,inthatitcarriestherangetableindex *ofthetargetrelationbeingconstrained;thisaidsplacingtheexpression *correctlyduringplanning.Wecanassumehoweverthatits"levelsup"is *alwayszero,duetothesyntacticconstraintsonwhereitcanappear. *Also,cvarnowillalwaysbeatrueRTindex,neverINNER_VARetc. * *Thereferencedcursorcanberepresentedeitherasahardwiredstring *orasareferencetoarun-timeparameteroftypeREFCURSOR.Thelatter *caseisfortheconvenienceofplpgsql.
*/ typedefstruct CurrentOfExpr
{
Expr xpr;
Index cvarno; /* RT index of target relation */ char *cursor_name; /* name of referenced cursor, or NULL */ int cursor_param; /* refcursor parameter number, or 0 */
} CurrentOfExpr;
/* *NextValueExpr-getnextvaluefromsequence * *Thishasthesameeffectascallingthenextval()function,butitdoesnot *checkpermissionsonthesequence.Thisisusedforidentitycolumns, *wherethesequenceisanimplicitdependencywithoutitsownpermissions.
*/ typedefstruct NextValueExpr
{
Expr xpr;
Oid seqid;
Oid typeId;
} NextValueExpr;
/* *InferenceElem-anelementofauniqueindexinferencespecification * *ThismostlymatchesthestructureofIndexElems,buthavingadedicated *primnodeallowsforacleanseparationbetweentheuseofindexparameters *byutilitycommands,andthisnode.
*/ typedefstruct InferenceElem
{
Expr xpr;
Node *expr; /* expression to infer from, or NULL */
Oid infercollid; /* OID of collation, or InvalidOid */
Oid inferopclass; /* OID of att opclass, or InvalidOid */
} InferenceElem;
/* *ReturningExpr-returnOLD/NEW.(expression)inRETURNINGlist * *Thisisusedwhenupdatinganauto-updatableviewandreturningaview *columnthatisnotsimplyaVarreferringtothebaserelation.Insuch *cases,OLD/NEW.viewcolcanexpandtoanarbitraryexpression,butthe *resultisrequiredtobeNULLiftheOLD/NEWrowdoesn'texist.Tohandle *this,therewriterwrapstheexpandedexpressioninaReturningExpr,which *isequivalentto"CASEWHEN(OLD/NEWrowexists)THEN(expr)ELSENULL". * *AsimilarsituationcanarisewhenrewritingtheRETURNINGclauseofa *rule,whichmayalsocontainarbitraryexpressions. * *ReturningExprnodesneverappearinaparsedQuery---theyareonlyever *insertedbytherewriterandtheplanner.
*/ typedefstruct ReturningExpr
{
Expr xpr; int retlevelsup; /* > 0 if it belongs to outer query */ bool retold; /* true for OLD, false for NEW */
Expr *retexpr; /* expression to be returned */
} ReturningExpr;
/*-------------------- *TargetEntry- *atargetentry(usedinquerytargetlists) * *Strictlyspeaking,aTargetEntryisn'tanexpressionnode(sinceitcan't *beevaluatedbyExecEvalExpr).Butwetreatitasoneanyway,sincein *verymanyplacesit'sconvenienttoprocessawholequerytargetlistasa *singleexpressiontree. * *InaSELECT'stargetlist,resnoshouldalwaysbeequaltotheitem's *ordinalposition(countingfrom1).However,inanINSERTorUPDATE *targetlist,resnorepresentstheattributenumberofthedestination *columnfortheitem;sotheremaybemissingorout-of-orderresnos. *Itisevenlegaltohaveduplicatedresnos;consider *UPDATEtableSETarraycol[1]=...,arraycol[2]=...,... *InanINSERT,therewriterandplannerwillnormalizethetlistby *reorderingitintophysicalcolumnorderandfillingindefaultvalues *foranycolumnsnotassignedvaluesbytheoriginalquery.InanUPDATE, *aftertherewritermergesmultipleassignmentsforthesamecolumn,the *plannerextractsthetarget-columnnumbersintoaseparate"update_colnos" *list,andthenrenumbersthetlistelementsserially.Thus,tlistresnos *matchordinalpositioninalltlistsseenbytheexecutor;butitiswrong *toassumethatbeforeplanninghashappened. * *resnameisrequiredtorepresentthecorrectcolumnnameinnon-resjunk *entriesoftop-levelSELECTtargetlists,sinceitwillbeusedasthe *columntitlesenttothefrontend.Inmostothercontextsitisonly *adebuggingaid,andmaybewrongorevenNULL.(Inparticular,itmay *bewronginatlistfromastoredrule,ifthereferencedcolumnhasbeen *renamedbyALTERTABLEsincetherulewasmade.Also,theplannertends *tostoreNULLratherthanlookupavalidnamefortlistentriesin *non-toplevelplannodes.)Inresjunkentries,resnameshouldbeeither *aspecificsystem-generatedname(suchas"ctid")orNULL;anythingelse *risksconfusingExecGetJunkAttribute! * *ressortgrouprefisusedintherepresentationofORDERBY,GROUPBY,and *DISTINCTitems.Targetlistentrieswithressortgroupref=0arenot *sort/groupitems.Ifressortgroupref>0,thenthisitemisanORDERBY, *GROUPBY,and/orDISTINCTtargetvalue.Notwoentriesinatargetlist *mayhavethesamenonzeroressortgroupref---butthereisnoparticular *meaningtothenonzerovalues,exceptastags.(Forexample,onemust *notassumethatlowerressortgrouprefmeansamoresignificantsortkey.) *TheorderoftheassociatedSortGroupClauselistsdeterminethesemantics. * *resorigtbl/resorigcolidentifythesourceofthecolumn,ifitisa *simplereferencetoacolumnofabasetable(orview).Ifitisnot *asimplereference,thesefieldsarezeroes. * *Ifresjunkistruethenthecolumnisaworkingcolumn(suchasasortkey) *thatshouldberemovedfromthefinaloutputofthequery.Resjunkcolumns *musthaveresnosthatcannotduplicateanyregularcolumn'sresno.Also *notethatthereareplacesthatassumeresjunkcolumnscomeafternon-junk *columns. *--------------------
*/ typedefstruct TargetEntry
{
Expr xpr; /* expression to evaluate */
Expr *expr; /* attribute number (see notes above) */
AttrNumber resno; /* name of the column (could be NULL) */ char *resname pg_node_attr(query_jumble_ignore); /* nonzero if referenced by a sort/group clause */
Index ressortgroupref; /* OID of column's source table */
Oid resorigtbl pg_node_attr(query_jumble_ignore); /* column's number in source table */
AttrNumber resorigcol pg_node_attr(query_jumble_ignore); /* set to true to eliminate the attribute from final target list */ bool resjunk pg_node_attr(query_jumble_ignore);
} TargetEntry;
/*---------- *JoinExpr-forSQLJOINexpressions * *isNatural,usingClause,andqualsareinterdependent.Theusercanwrite *onlyoneofNATURAL,USING(),orON()(thisisenforcedbythegrammar). *IfhewritesNATURALthenparseanalysisgeneratestheequivalentUSING() *list,andfromthatfillsin"quals"withtherightequalitycomparisons. *IfhewritesUSING()then"quals"isfilledwithequalitycomparisons. *IfhewritesON()thenonly"quals"isset.NotethatNATURAL/USING *arenotequivalenttoON()sincetheyalsoaffecttheoutputcolumnlist. * *aliasisanAliasnoderepresentingtheASalias-clauseattachedtothe *joinexpression,orNULLifnoclause.NB:presenceorabsenceofthe *aliashasacriticalimpactonsemantics,becauseajoinwithanalias *restrictsvisibilityofthetables/columnsinsideit. * *join_using_aliasisanAliasnoderepresentingthejoincorrelation *namethatSQL:2016andlaterallowtobeattachedtoJOIN/USING. *ItscolumnaliaslistincludesonlythecommoncolumnnamesfromUSING, *anditdoesnotrestrictvisibilityofthejoin'sinputtables. * *Duringparseanalysis,anRTEiscreatedfortheJoin,anditsindex *isfilledintortindex.ThisRTEispresentmainlysothatVarscan *becreatedthatrefertotheoutputsofthejoin.Theplannersometimes *generatesJoinExprsinternally;thesecanhavertindex=0ifthereare *nojoinaliasvariablesreferencingsuchjoins. *----------
*/ typedefstruct JoinExpr
{
NodeTag type;
JoinType jointype; /* type of join */ bool isNatural; /* Natural join? Will need to shape table */
Node *larg; /* left subtree */
Node *rarg; /* right subtree */ /* USING clause, if any (list of String) */
List *usingClause pg_node_attr(query_jumble_ignore); /* alias attached to USING clause, if any */
Alias *join_using_alias pg_node_attr(query_jumble_ignore); /* qualifiers on join, if any */
Node *quals; /* user-written alias clause, if any */
Alias *alias pg_node_attr(query_jumble_ignore); /* RT index assigned for join, or 0 */ int rtindex;
} JoinExpr;
/*---------- *FromExpr-representsaFROM...WHERE...construct * *ThisisbothmoreflexiblethanaJoinExpr(itcanhaveanynumberof *children,includingzero)andlessso---wedon'tneedtodealwith *aliasesandsoon.Theoutputcolumnsetisimplicitlyjusttheunion *oftheoutputsofthechildren. *----------
*/ typedefstruct FromExpr
{
NodeTag type;
List *fromlist; /* List of join subtrees */
Node *quals; /* qualifiers on join, if any */
} FromExpr;
/* Arbiter */
List *arbiterElems; /* unique index arbiter list (of
* InferenceElem's) */
Node *arbiterWhere; /* unique index arbiter WHERE clause */
Oid constraint; /* pg_constraint OID for arbiter */
/* ON CONFLICT UPDATE */
List *onConflictSet; /* List of ON CONFLICT SET TargetEntrys */
Node *onConflictWhere; /* qualifiers to restrict UPDATE to */ int exclRelIndex; /* RT index of 'excluded' relation */
List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
} OnConflictExpr;
#endif/* PRIMNODES_H */
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.95Bemerkung:
(vorverarbeitet am 2026-08-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.