/* Possible sources of a Query */ typedefenum QuerySource
{
QSRC_ORIGINAL, /* original parsetree (explicit query) */
QSRC_PARSER, /* added by parse analysis (now unused) */
QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
QSRC_NON_INSTEAD_RULE, /* added by non-INSTEAD rule */
} QuerySource;
/* Sort ordering options for ORDER BY and CREATE INDEX */ typedefenum SortByDir
{
SORTBY_DEFAULT,
SORTBY_ASC,
SORTBY_DESC,
SORTBY_USING, /* not allowed in CREATE INDEX ... */
} SortByDir;
/* do I set the command result tag? */ bool canSetTag pg_node_attr(query_jumble_ignore);
Node *utilityStmt; /* non-null if commandType == CMD_UTILITY */
/* *rtableindexoftargetrelationforINSERT/UPDATE/DELETE/MERGE;0for *SELECT.Thisisignoredinthequeryjumbleasunrelatedtothe *compilationofthequeryID.
*/ int resultRelation pg_node_attr(query_jumble_ignore);
/* has aggregates in tlist or havingQual */ bool hasAggs pg_node_attr(query_jumble_ignore); /* has window functions in tlist */ bool hasWindowFuncs pg_node_attr(query_jumble_ignore); /* has set-returning functions in tlist */ bool hasTargetSRFs pg_node_attr(query_jumble_ignore); /* has subquery SubLink */ bool hasSubLinks pg_node_attr(query_jumble_ignore); /* distinctClause is from DISTINCT ON */ bool hasDistinctOn pg_node_attr(query_jumble_ignore); /* WITH RECURSIVE was specified */ bool hasRecursive pg_node_attr(query_jumble_ignore); /* has INSERT/UPDATE/DELETE/MERGE in WITH */ bool hasModifyingCTE pg_node_attr(query_jumble_ignore); /* FOR [KEY] UPDATE/SHARE was specified */ bool hasForUpdate pg_node_attr(query_jumble_ignore); /* rewriter has applied some RLS policy */ bool hasRowSecurity pg_node_attr(query_jumble_ignore); /* parser has added an RTE_GROUP RTE */ bool hasGroupRTE pg_node_attr(query_jumble_ignore); /* is a RETURN statement */ bool isReturn pg_node_attr(query_jumble_ignore);
List *cteList; /* WITH list (of CommonTableExpr's) */
List *rtable; /* list of range table entries */
/* *listofRTEPermissionInfonodesforthertableentrieshaving *perminfoindex>0
*/
List *rteperminfos pg_node_attr(query_jumble_ignore);
FromExpr *jointree; /* table join tree (FROM and WHERE clauses);
* also USING clause for MERGE */
List *mergeActionList; /* list of actions for MERGE (only) */
/* *rtableindexoftargetrelationforMERGEtopulldata.Initially,this *isthesameasresultRelation,butafterqueryrewriting,ifthetarget *relationisatrigger-updatableview,thisistheindexoftheexpanded *viewsubquery,whereasresultRelationistheindexofthetargetview.
*/ int mergeTargetRelation pg_node_attr(query_jumble_ignore);
/* join condition between source and target for MERGE */
Node *mergeJoinCondition;
List *targetList; /* target list (of TargetEntry) */
List *groupClause; /* a list of SortGroupClause's */ bool groupDistinct; /* is the group by clause distinct? */
List *groupingSets; /* a list of GroupingSet's if present */
Node *havingQual; /* qualifications applied to groups */
List *windowClause; /* a list of WindowClause's */
List *distinctClause; /* a list of SortGroupClause's */
List *sortClause; /* a list of SortGroupClause's */
Node *limitOffset; /* # of result tuples to skip (int8 expr) */
Node *limitCount; /* # of result tuples to return (int8 expr) */
LimitOption limitOption; /* limit type */
List *rowMarks; /* a list of RowMarkClause's */
Node *setOperations; /* set-operation tree if this is top level of
* a UNION/INTERSECT/EXCEPT query */
/* *Alistofpg_constraintOIDsthatthequerydependsontobe *semanticallyvalid
*/
List *constraintDeps pg_node_attr(query_jumble_ignore);
/* a list of WithCheckOption's (added during rewrite) */
List *withCheckOptions pg_node_attr(query_jumble_ignore);
/* *Thefollowingtwofieldsidentifytheportionofthesourcetextstring *containingthisquery.Theyaretypicallyonlypopulatedintop-level *Queries,notinsub-queries.Whennotset,theymightbothbezero,or *bothbe-1meaning"unknown".
*/ /* start location, or -1 if unknown */
ParseLoc stmt_location; /* length in bytes; 0 means "rest of string" */
ParseLoc stmt_len pg_node_attr(query_jumble_ignore);
} Query;
/* *TypeName-specifiesatypeindefinitions * *ForTypeNamestructuresgeneratedinternally,itisofteneasierto *specifythetypebyOIDthanbyname.If"names"isNILthenthe *actualtypeOIDisgivenbytypeOid,otherwisetypeOidisunused. *Similarly,if"typmods"isNILthentheactualtypmodisexpectedto *beprespecifiedintypemod,otherwisetypemodisunused. * *Ifpct_typeistrue,thennamesisactuallyafieldnameandwelookup *thetypeofthatfield.Otherwise(thenormalcase),namesisatype *namepossiblyqualifiedwithschemaanddatabasename.
*/ typedefstructTypeName
{
NodeTag type;
List *names; /* qualified name (list of String nodes) */
Oid typeOid; /* type identified by OID */ bool setof; /* is a set? */ bool pct_type; /* %TYPE specified? */
List *typmods; /* type modifier expression(s) */
int32 typemod; /* prespecified type modifier */
List *arrayBounds; /* array bounds */
ParseLoc location; /* token location, or -1 if unknown */
} TypeName;
/* *ColumnRef-specifiesareferencetoacolumn,orpossiblyawholetuple * *The"fields"listmustbenonempty.ItcancontainStringnodes *(representingnames)andA_Starnodes(representingoccurrenceofa'*'). *Currently,A_Starmustappearonlyasthelastlistelement---thegrammar *isresponsibleforenforcingthis! * *Note:anycontainersubscriptingorselectionoffieldsfromcompositecolumns *isrepresentedbyanA_IndirectionnodeabovetheColumnRef.However, *forsimplicityinthenormalcase,initialfieldselectionfromatable *nameisrepresentedwithinColumnRefandnotbyaddingA_Indirection.
*/ typedefstruct ColumnRef
{
NodeTag type;
List *fields; /* field names (String nodes) or A_Star */
ParseLoc location; /* token location, or -1 if unknown */
} ColumnRef;
/* *ParamRef-specifiesa$nparameterreference
*/ typedefstruct ParamRef
{
NodeTag type; int number; /* the number of the parameter */
ParseLoc location; /* token location, or -1 if unknown */
} ParamRef;
/* *A_Expr-infix,prefix,andpostfixexpressions
*/ typedefenum A_Expr_Kind
{
AEXPR_OP, /* normal operator */
AEXPR_OP_ANY, /* scalar op ANY (array) */
AEXPR_OP_ALL, /* scalar op ALL (array) */
AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
AEXPR_NOT_DISTINCT, /* IS NOT DISTINCT FROM - name must be "=" */
AEXPR_NULLIF, /* NULLIF - name must be "=" */
AEXPR_IN, /* [NOT] IN - name must be "=" or "<>" */
AEXPR_LIKE, /* [NOT] LIKE - name must be "~~" or "!~~" */
AEXPR_ILIKE, /* [NOT] ILIKE - name must be "~~*" or "!~~*" */
AEXPR_SIMILAR, /* [NOT] SIMILAR - name must be "~" or "!~" */
AEXPR_BETWEEN, /* name must be "BETWEEN" */
AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */
AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */
AEXPR_NOT_BETWEEN_SYM, /* name must be "NOT BETWEEN SYMMETRIC" */
} A_Expr_Kind;
NodeTag type;
A_Expr_Kind kind; /* see above */
List *name; /* possibly-qualified name of operator */
Node *lexpr; /* left argument, or NULL if none */
Node *rexpr; /* right argument, or NULL if none */
NodeTag type; union ValUnion val; bool isnull; /* SQL NULL constant */
ParseLoc location; /* token location, or -1 if unknown */
} A_Const;
/* *TypeCast-aCASTexpression
*/ typedefstruct TypeCast
{
NodeTag type;
Node *arg; /* the expression being casted */ TypeName *typeName; /* the target type */
ParseLoc location; /* token location, or -1 if unknown */
} TypeCast;
/* *CollateClause-aCOLLATEexpression
*/ typedefstruct CollateClause
{
NodeTag type;
Node *arg; /* input expression */
List *collname; /* possibly-qualified collation name */
ParseLoc location; /* token location, or -1 if unknown */
} CollateClause;
/* *RoleSpec-arolenameoroneofafewspecialvalues.
*/ typedefenum RoleSpecType
{
ROLESPEC_CSTRING, /* role name is stored as a C string */
ROLESPEC_CURRENT_ROLE, /* role spec is CURRENT_ROLE */
ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
ROLESPEC_PUBLIC, /* role name is "public" */
} RoleSpecType;
typedefstruct RoleSpec
{
NodeTag type;
RoleSpecType roletype; /* Type of this rolespec */ char *rolename; /* filled only for ROLESPEC_CSTRING */
ParseLoc location; /* token location, or -1 if unknown */
} RoleSpec;
/* *FuncCall-afunctionoraggregateinvocation * *agg_order(ifnotNIL)indicateswesaw'foo(...ORDERBY...)',orif *agg_within_groupistrue,itwas'foo(...)WITHINGROUP(ORDERBY...)'. *agg_starindicateswesawa'foo(*)'construct,whileagg_distinct *indicateswesaw'foo(DISTINCT...)'.Inanyofthesecases,the *construct*must*beanaggregatecall.Otherwise,itmightbeeitheran *aggregateorsomeotherkindoffunction.However,ifFILTERorOVERis *presentithadbetterbeanaggregateorwindowfunction. * *Normally,you'dinitializethisviamakeFuncCall()andthenonlychangethe *partsofthestructitsdefaultsdon'tmatchafterwards,asneeded.
*/ typedefstruct FuncCall
{
NodeTag type;
List *funcname; /* qualified name of function */
List *args; /* the arguments (list of exprs) */
List *agg_order; /* ORDER BY (list of SortBy) */
Node *agg_filter; /* FILTER clause, if any */ struct WindowDef *over; /* OVER clause, if any */ bool agg_within_group; /* ORDER BY appeared in WITHIN GROUP */ bool agg_star; /* argument was really '*' */ bool agg_distinct; /* arguments were labeled DISTINCT */ bool func_variadic; /* last argument was labeled VARIADIC */
CoercionForm funcformat; /* how to display this node */
ParseLoc location; /* token location, or -1 if unknown */
} FuncCall;
/* *A_Indices-arraysubscriptorslicebounds([idx]or[lidx:uidx]) * *Inslicecase,eitherorbothoflidxanduidxcanbeNULL(omitted). *Innon-slicecase,uidxholdsthesinglesubscriptandlidxisalwaysNULL.
*/ typedefstruct A_Indices
{
NodeTag type; bool is_slice; /* true if slice (i.e., colon present) */
Node *lidx; /* slice lower bound, if any */
Node *uidx; /* subscript, or slice upper bound if any */
} A_Indices;
/* *A_Indirection-selectafieldand/orarrayelementfromanexpression * *TheindirectionlistcancontainA_Indicesnodes(representing *subscripting),Stringnodes(representingfieldselection---the *stringvalueisthenameofthefieldtoselect),andA_Starnodes *(representingselectionofallfieldsofacompositetype). *Forexample,acomplexselectionoperationlike *(foo).field1[42][7].field2 *wouldberepresentedwithasingleA_Indirectionnodehavinga4-element *indirectionlist. * *Currently,A_Starmustappearonlyasthelastlistelement---thegrammar *isresponsibleforenforcingthis!
*/ typedefstruct A_Indirection
{
NodeTag type;
Node *arg; /* the thing being selected from */
List *indirection; /* subscripts and/or field names and/or * */
} A_Indirection;
/* *A_ArrayExpr-anARRAY[]construct
*/ typedefstruct A_ArrayExpr
{
NodeTag type;
List *elements; /* array element expressions */
ParseLoc list_start; /* start of the element list */
ParseLoc list_end; /* end of the elements list */
ParseLoc location; /* token location, or -1 if unknown */
} A_ArrayExpr;
/* *ResTarget- *resulttarget(usedintargetlistofpre-transformedparsetrees) * *InaSELECTtargetlist,'name'isthecolumnlabelfroman *'ASColumnLabel'clause,orNULLiftherewasnone,and'val'isthe *valueexpressionitself.The'indirection'fieldisnotused. * *INSERTusesResTargetinitstarget-column-nameslist.Here,'name'is *thenameofthedestinationcolumn,'indirection'storesanysubscripts *attachedtothedestination,and'val'isnotused. * *InanUPDATEtargetlist,'name'isthenameofthedestinationcolumn, *'indirection'storesanysubscriptsattachedtothedestination,and *'val'istheexpressiontoassign. * *SeeA_Indirectionformoreinfoaboutwhatcanappearin'indirection'.
*/ typedefstruct ResTarget
{
NodeTag type; char *name; /* column name or NULL */
List *indirection; /* subscripts, field names, and '*', or NIL */
Node *val; /* the value expression to compute or assign */
ParseLoc location; /* token location, or -1 if unknown */
} ResTarget;
/* *MultiAssignRef-elementofarowsourceexpressionforUPDATE * *InanUPDATEtargetlist,whenwehaveSET(a,b,c)=row-valued-expression, *wegenerateseparateResTargetitemsforeachofa,b,c.Their"val"trees *areMultiAssignRefnodesnumbered1..n,linkingtoacommoncopyofthe *row-valued-expression(whichparseanalysiswillprocessonlyonce,when *handlingtheMultiAssignRefwithcolno=1).
*/ typedefstruct MultiAssignRef
{
NodeTag type;
Node *source; /* the row-valued expression */ int colno; /* column number for this target (1..n) */ int ncolumns; /* number of targets in the construct */
} MultiAssignRef;
/* *SortBy-forORDERBYclause
*/ typedefstruct SortBy
{
NodeTag type;
Node *node; /* expression to sort on */
SortByDir sortby_dir; /* ASC/DESC/USING/default */
SortByNulls sortby_nulls; /* NULLS FIRST/LAST */
List *useOp; /* name of op to use, if SORTBY_USING */
ParseLoc location; /* operator location, or -1 if none/unknown */
} SortBy;
/* *WindowDef-rawrepresentationofWINDOWandOVERclauses * *ForentriesinaWINDOWlist,"name"isthewindownamebeingdefined. *ForOVERclauses,weuse"name"forthe"OVERwindow"syntax,or"refname" *forthe"OVER(window)"syntax,whichissubtlydifferent---thelatter *impliesoverridingthewindowframeclause.
*/ typedefstruct WindowDef
{
NodeTag type; char *name; /* window's own name */ char *refname; /* referenced window name, if any */
List *partitionClause; /* PARTITION BY expression list */
List *orderClause; /* ORDER BY (list of SortBy) */ int frameOptions; /* frame_clause options, see below */
Node *startOffset; /* expression for starting bound, if any */
Node *endOffset; /* expression for ending bound, if any */
ParseLoc location; /* parse location, or -1 if none/unknown */
} WindowDef;
/* *frameOptionsisanORofthesebits.TheNONDEFAULTandBETWEENbitsare *usedsothatruleutils.ccantellwhichpropertieswerespecifiedand *whichweredefaulted;thecorrectbehavioralbitsmustbeseteitherway. *TheSTART_fooandEND_foooptionsmustcomeinpairsofadjacentbitsfor *theconvenienceofgram.y,eventhoughsomeofthemareuseless/invalid.
*/ #define FRAMEOPTION_NONDEFAULT 0x00001 /* any specified? */ #define FRAMEOPTION_RANGE 0x00002 /* RANGE behavior */ #define FRAMEOPTION_ROWS 0x00004 /* ROWS behavior */ #define FRAMEOPTION_GROUPS 0x00008 /* GROUPS behavior */ #define FRAMEOPTION_BETWEEN 0x00010 /* BETWEEN given? */ #define FRAMEOPTION_START_UNBOUNDED_PRECEDING 0x00020 /* start is U. P. */ #define FRAMEOPTION_END_UNBOUNDED_PRECEDING 0x00040 /* (disallowed) */ #define FRAMEOPTION_START_UNBOUNDED_FOLLOWING 0x00080 /* (disallowed) */ #define FRAMEOPTION_END_UNBOUNDED_FOLLOWING 0x00100 /* end is U. F. */ #define FRAMEOPTION_START_CURRENT_ROW 0x00200 /* start is C. R. */ #define FRAMEOPTION_END_CURRENT_ROW 0x00400 /* end is C. R. */ #define FRAMEOPTION_START_OFFSET_PRECEDING 0x00800 /* start is O. P. */ #define FRAMEOPTION_END_OFFSET_PRECEDING 0x01000 /* end is O. P. */ #define FRAMEOPTION_START_OFFSET_FOLLOWING 0x02000 /* start is O. F. */ #define FRAMEOPTION_END_OFFSET_FOLLOWING 0x04000 /* end is O. F. */ #define FRAMEOPTION_EXCLUDE_CURRENT_ROW 0x08000 /* omit C.R. */ #define FRAMEOPTION_EXCLUDE_GROUP 0x10000 /* omit C.R. & peers */ #define FRAMEOPTION_EXCLUDE_TIES 0x20000 /* omit C.R.'s peers */
/* *RangeSubselect-subqueryappearinginaFROMclause
*/ typedefstruct RangeSubselect
{
NodeTag type; bool lateral; /* does it have LATERAL prefix? */
Node *subquery; /* the untransformed sub-select clause */
Alias *alias; /* table alias & optional column aliases */
} RangeSubselect;
/* *RangeFunction-functioncallappearinginaFROMclause * *functionsisaListbecauseweusethistorepresenttheconstruct *ROWSFROM(func1(...),func2(...),...).Eachelementofthislistisa *two-elementsublist,thefirstelementbeingtheuntransformedfunction *calltree,andthesecondelementbeingapossibly-emptylistofColumnDef *nodesrepresentinganycolumndeflistattachedtothatfunctionwithinthe *ROWSFROM()syntax. * *aliasandcoldeflistrepresentanyaliasand/orcolumndeflistattached *atthetoplevel.(Wedisallowcoldeflistappearingbothhereand *per-function,butthat'scheckedinparseanalysis,notbythegrammar.)
*/ typedefstruct RangeFunction
{
NodeTag type; bool lateral; /* does it have LATERAL prefix? */ bool ordinality; /* does it have WITH ORDINALITY suffix? */ bool is_rowsfrom; /* is result of ROWS FROM() syntax? */
List *functions; /* per-function information, see above */
Alias *alias; /* table alias & optional column aliases */
List *coldeflist; /* list of ColumnDef nodes to describe result
* of function returning RECORD */
} RangeFunction;
/* *RangeTableFunc-rawformof"tablefunctions"suchasXMLTABLE * *Note:JSON_TABLEisalsoa"tablefunction",butitusesJsonTablenode, *notRangeTableFunc.
*/ typedefstruct RangeTableFunc
{
NodeTag type; bool lateral; /* does it have LATERAL prefix? */
Node *docexpr; /* document expression */
Node *rowexpr; /* row generator expression */
List *namespaces; /* list of namespaces as ResTarget */
List *columns; /* list of RangeTableFuncCol */
Alias *alias; /* table alias & optional column aliases */
ParseLoc location; /* token location, or -1 if unknown */
} RangeTableFunc;
/* *RangeTableFuncCol-onecolumninaRangeTableFunc->columns * *Iffor_ordinalityistrue(FORORDINALITY),thenthecolumnisanint4 *columnandtherestofthefieldsareignored.
*/ typedefstruct RangeTableFuncCol
{
NodeTag type; char *colname; /* name of generated column */ TypeName *typeName; /* type of generated column */ bool for_ordinality; /* does it have FOR ORDINALITY? */ bool is_not_null; /* does it have NOT NULL? */
Node *colexpr; /* column filter expression */
Node *coldefexpr; /* column default value expression */
ParseLoc location; /* token location, or -1 if unknown */
} RangeTableFuncCol;
/* *RangeTableSample-TABLESAMPLEappearinginarawFROMclause * *Thisnode,appearingonlyinrawparsetrees,represents *<relation>TABLESAMPLE<method>(<params>)REPEATABLE(<num>) *Currently,the<relation>canonlybeaRangeVar,butwemightinfuture *allowRangeSubselectandotheroptions.NotethattheRangeTableSample *iswrappedaroundthenoderepresentingthe<relation>,ratherthanbeing *asubfieldofit.
*/ typedefstruct RangeTableSample
{
NodeTag type;
Node *relation; /* relation to be sampled */
List *method; /* sampling method name (possibly qualified) */
List *args; /* argument(s) for sampling method */
Node *repeatable; /* REPEATABLE expression, or NULL if none */
ParseLoc location; /* method name location, or -1 if unknown */
} RangeTableSample;
/* *ColumnDef-columndefinition(usedinvariouscreates) * *Ifthecolumnhasadefaultvalue,wemayhavethevalueexpression *ineither"raw"form(anuntransformedparsetree)or"cooked"form *(apost-parse-analysis,executableexpressiontree),dependingon *howthisColumnDefnodewascreated(byparsing,orbyinheritance *fromanexistingrelation).Weshouldneverhavebothinthesamenode! * *Similarly,wemayhaveaCOLLATEspecificationineitherrawform *(representedasaCollateClausewitharg==NULL)orcookedform *(thecollation'sOID). * *TheconstraintslistmaycontainaCONSTR_DEFAULTiteminaraw *parsetreeproducedbygram.y,buttransformCreateStmtwillremove *theitemandsetraw_defaultinstead.CONSTR_DEFAULTitems *shouldnotappearinanysubsequentprocessing.
*/ typedefstruct ColumnDef
{
NodeTag type; char *colname; /* name of column */ TypeName *typeName; /* type of column */ char *compression; /* compression method for column */
int16 inhcount; /* number of times column is inherited */ bool is_local; /* column has local (non-inherited) def'n */ bool is_not_null; /* NOT NULL constraint specified? */ bool is_from_type; /* column definition came from table type */ char storage; /* attstorage setting, or 0 for default */ char *storage_name; /* attstorage setting name or NULL for default */
Node *raw_default; /* default value (untransformed parse tree) */
Node *cooked_default; /* default value (transformed expr tree) */ char identity; /* attidentity setting */
RangeVar *identitySequence; /* to store identity sequence name for
* ALTER TABLE ... ADD COLUMN */ char generated; /* attgenerated setting */
CollateClause *collClause; /* untransformed COLLATE spec, if any */
Oid collOid; /* collation OID (InvalidOid if not set) */
List *constraints; /* other constraints on column */
List *fdwoptions; /* per-column FDW options */
ParseLoc location; /* parse location, or -1 if none/unknown */
} ColumnDef;
/* *TableLikeClause-CREATETABLE(...LIKE...)clause
*/ typedefstruct TableLikeClause
{
NodeTag type;
RangeVar *relation;
bits32 options; /* OR of TableLikeOption flags */
Oid relationOid; /* If table has been looked up, its OID */
} TableLikeClause;
/* *IndexElem-indexparameters(usedinCREATEINDEX,andinONCONFLICT) * *Foraplainindexattribute,'name'isthenameofthetablecolumnto *index,and'expr'isNULL.Foranindexexpression,'name'isNULLand *'expr'istheexpressiontree.
*/ typedefstruct IndexElem
{
NodeTag type; char *name; /* name of attribute to index, or NULL */
Node *expr; /* expression to index, or NULL */ char *indexcolname; /* name for index column; NULL = default */
List *collation; /* name of collation; NIL = default */
List *opclass; /* name of desired opclass; NIL = default */
List *opclassopts; /* opclass-specific options, or NIL */
SortByDir ordering; /* ASC/DESC/default */
SortByNulls nulls_ordering; /* FIRST/LAST/default */
} IndexElem;
/* *PartitionElem-parse-timerepresentationofasinglepartitionkey * *exprcanbeeitherarawexpressiontreeoraparse-analyzedexpression. *Wedon'tstoretheseon-disk,though.
*/ typedefstruct PartitionElem
{
NodeTag type; char *name; /* name of column to partition on, or NULL */
Node *expr; /* expression to partition on, or NULL */
List *collation; /* name of collation; NIL = default */
List *opclass; /* name of desired opclass; NIL = default */
ParseLoc location; /* token location, or -1 if unknown */
} PartitionElem;
char strategy; /* see PARTITION_STRATEGY codes above */ bool is_default; /* is it a default partition bound? */
/* Partitioning info for HASH strategy: */ int modulus; int remainder;
/* Partitioning info for LIST strategy: */
List *listdatums; /* List of Consts (or A_Consts in raw tree) */
/* Partitioning info for RANGE strategy: */
List *lowerdatums; /* List of PartitionRangeDatums */
List *upperdatums; /* List of PartitionRangeDatums */
ParseLoc location; /* token location, or -1 if unknown */
};
/* *PartitionRangeDatum-oneofthevaluesinarangepartitionbound * *ThiscanbeMINVALUE,MAXVALUEoraspecificboundedvalue.
*/ typedefenum PartitionRangeDatumKind
{
PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */
} PartitionRangeDatumKind;
typedefstruct PartitionRangeDatum
{
NodeTag type;
PartitionRangeDatumKind kind;
Node *value; /* Const (or A_Const in raw tree), if kind is
* PARTITION_RANGE_DATUM_VALUE, else NULL */
ParseLoc location; /* token location, or -1 if unknown */
} PartitionRangeDatum;
/* *PartitionCmd-infoforALTERTABLE/INDEXATTACH/DETACHPARTITIONcommands
*/ typedefstruct PartitionCmd
{
NodeTag type;
RangeVar *name; /* name of partition to attach/detach */
PartitionBoundSpec *bound; /* FOR VALUES, if attaching */ bool concurrent;
} PartitionCmd;
/* *FieldsvalidinallRTEs: * *putalias+ereffirsttomakedumpmorelegible
*/ /* user-written alias clause, if any */
Alias *alias pg_node_attr(query_jumble_ignore);
/* *Expandedreferencenames.Thisusesacustomqueryjumblefunctionso *thatthetablenameisincludedinthecomputation,butnotitslistof *columns.
*/
Alias *eref pg_node_attr(custom_query_jumble);
RTEKind rtekind; /* see above */
/* *FieldsvalidforaplainrelationRTE(elsezero): * *inhistrueforrelationreferencesthatshouldbeexpandedtoinclude *inheritancechildren,iftherelhasany.Intheparser,thiswill *onlybetrueforRTE_RELATIONentries.Theplanneralsousesthis *fieldtomarkRTE_SUBQUERYentriesthatcontainUNIONALLqueriesthat *ithasflattenedintopulled-upsubqueries(creatingastructuremuch *liketheeffectsofinheritance). * *rellockmodeisreallyLOCKMODE,butit'sdeclaredinttoavoidhaving *toincludelock-relatedheadershere.ItmustbeRowExclusiveLockif *theRTEisanINSERT/UPDATE/DELETE/MERGEtarget,elseRowShareLockif *theRTEisaSELECTFORUPDATE/FORSHAREtarget,elseAccessShareLock. * *Note:insomecases,ruleexpansionmayresultinRTEsthataremarked *withRowExclusiveLockeventhoughtheyarenotthetargetofthe *currentquery;thishappensifaDOALSOrulesimplyscanstheoriginal *targettable.WeleavesuchRTEswiththeiroriginallockmodesoasto *avoidgettinganadditional,lesserlock. * *perminfoindexis1-basedindexoftheRTEPermissionInfobelongingto *thisRTEinthecontainingstruct'slistofsame;0ifpermissionsneed *notbecheckedforthisRTE. * *Asaspecialcase,relid,relkind,rellockmode,andperminfoindexcan *alsobeset(nonzero)inanRTE_SUBQUERYRTE.Thisoccurswhenwe *convertanRTE_RELATIONRTEnamingaviewintoanRTE_SUBQUERY *containingtheview'squery.Westillneedtoperformrun-timelocking *andpermissionchecksontheview,eventhoughit'snotdirectlyused *inthequeryanymore,andthemostexpedientwaytodothatisto *retainthesefieldsfromtheoldstateoftheRTE. * *Asaspecialcase,RTE_NAMEDTUPLESTOREcanalsosetrelidtoindicate *thatthetupleformatofthetuplestoreisthesameasthereferenced *relation.ThisallowsplansreferencingAFTERtriggertransition *tablestobeinvalidatediftheunderlyingtableisaltered.
*/ /* OID of the relation */
Oid relid pg_node_attr(query_jumble_ignore); /* inheritance requested? */ bool inh; /* relation kind (see pg_class.relkind) */ char relkind pg_node_attr(query_jumble_ignore); /* lock level that query requires on the rel */ int rellockmode pg_node_attr(query_jumble_ignore); /* index of RTEPermissionInfo entry, or 0 */
Index perminfoindex pg_node_attr(query_jumble_ignore); /* sampling info, or NULL */ struct TableSampleClause *tablesample;
/* *FieldsvalidforasubqueryRTE(elseNULL):
*/ /* the sub-query */
Query *subquery; /* is from security_barrier view? */ bool security_barrier pg_node_attr(query_jumble_ignore);
/* *join_using_aliasisanaliasclauseattacheddirectlytoJOIN/USING.It *isdifferentfromthealiasfield(below)inthatitdoesnothidethe *rangevariablesofthetablesbeingjoined.
*/
Alias *join_using_alias pg_node_attr(query_jumble_ignore);
/* *FieldsvalidforafunctionRTE(elseNIL/zero): * *Whenfuncordinalityistrue,theeref->colnameslistincludesanalias *fortheordinalitycolumn.Theordinalitycolumnisotherwise *implicit,andmustbeaccountedfor"byhand"inplacessuchas *expandRTE().
*/ /* list of RangeTblFunction nodes */
List *functions; /* is this called WITH ORDINALITY? */ bool funcordinality;
/* *FieldsvalidforavaluesRTE(elseNIL):
*/ /* list of expression lists */
List *values_lists;
/* *FieldsvalidforaCTERTE(elseNULL/zero):
*/ /* name of the WITH list item */ char *ctename; /* number of query levels up */
Index ctelevelsup; /* is this a recursive self-reference? */ bool self_reference pg_node_attr(query_jumble_ignore);
/* *FieldsvalidforCTE,VALUES,ENR,andTableFuncRTEs(elseNIL): * *WeneedtheseforCTERTEssothatthetypesofself-referential *columnsarewell-defined.ForVALUESRTEs,storingtheseexplicitly *saveshavingtore-determinetheinfobyscanningthevalues_lists.For *ENRs,westorethetypesexplicitlyhere(wecouldgettheinformation *fromthecatalogsif'relid'wassupplied,butwe'dstillneedthese *forTupleDesc-basedENRs,sowemightaswellalwaysstorethetype *infohere).ForTableFuncs,thesefieldsareredundantwithdatain *theTableFuncnode,butkeepingthemhereallowssomecodesharingwith *theothercases. * *ForENRsonly,wehavetoconsiderthepossibilityofdroppedcolumns. *Adroppedcolumnisincludedintheselists,butitwillhavezeroesin *allthreelists(aswellasanempty-stringentryineref).Testing *forzerocoltypeisthestandardwaytodetectadroppedcolumn.
*/ /* 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);
/* *FieldsvalidforENRRTEs(elseNULL/zero):
*/ /* name of ephemeral named relation */ char *enrname; /* estimated or actual from caller */
Cardinality enrtuples pg_node_attr(query_jumble_ignore);
/* *FieldsvalidforaGROUPRTE(elseNIL):
*/ /* list of grouping expressions */
List *groupexprs;
/* *FieldsvalidinallRTEs:
*/ /* was LATERAL specified? */ bool lateral pg_node_attr(query_jumble_ignore); /* present in FROM clause? */ bool inFromCl pg_node_attr(query_jumble_ignore); /* security barrier quals to apply, if any */
List *securityQuals pg_node_attr(query_jumble_ignore);
} RangeTblEntry;
Node *funcexpr; /* expression tree for func call */ /* number of columns it contributes to RTE */ int funccolcount pg_node_attr(query_jumble_ignore); /* These fields record the contents of a column definition list, if any: */ /* column names (list of String) */
List *funccolnames pg_node_attr(query_jumble_ignore); /* OID list of column type OIDs */
List *funccoltypes pg_node_attr(query_jumble_ignore); /* integer list of column typmods */
List *funccoltypmods pg_node_attr(query_jumble_ignore); /* OID list of column collation OIDs */
List *funccolcollations pg_node_attr(query_jumble_ignore);
/* This is set during planning for use by the executor: */ /* PARAM_EXEC Param IDs affecting this func */
Bitmapset *funcparams pg_node_attr(query_jumble_ignore);
} RangeTblFunction;
/* *TableSampleClause-TABLESAMPLEappearinginatransformedFROMclause * *UnlikeRangeTableSample,thisisasubnodeoftherelevantRangeTblEntry.
*/ typedefstruct TableSampleClause
{
NodeTag type;
Oid tsmhandler; /* OID of the tablesample handler function */
List *args; /* tablesample argument expression(s) */
Expr *repeatable; /* REPEATABLE expression, or NULL if none */
} TableSampleClause;
/* *WithCheckOption- *representationofWITHCHECKOPTIONcheckstobeappliedtonewtuples *wheninserting/updatinganauto-updatableview,orRLSWITHCHECK *policiestobeappliedwheninserting/updatingarelationwithRLS.
*/ typedefenum WCOKind
{
WCO_VIEW_CHECK, /* WCO on an auto-updatable view */
WCO_RLS_INSERT_CHECK, /* RLS INSERT WITH CHECK policy */
WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO UPDATE USING policy */
WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
} WCOKind;
typedefstruct WithCheckOption
{
NodeTag type;
WCOKind kind; /* kind of WCO */ char *relname; /* name of relation that specified the WCO */ char *polname; /* name of RLS policy being checked */
Node *qual; /* constraint qual to check */ bool cascaded; /* true for a cascaded WCO on a view */
} WithCheckOption;
/* *SortGroupClause- *representationofORDERBY,GROUPBY,PARTITIONBY, *DISTINCT,DISTINCTONitems * *YoumightthinkthatORDERBYisonlyinterestedindefiningordering, *andGROUP/DISTINCTareonlyinterestedindefiningequality.However, *onewaytoimplementgroupingistosortandthenapplya"uniq"-like *filter.Soit'salsointerestingtokeeptrackofpossiblesortoperators *forGROUP/DISTINCT,andinparticulartotrytosortforthegrouping *inawaythatwillalsoyieldarequestedORDERBYordering.Soweneed *tobeabletocompareORDERBYandGROUP/DISTINCTlists,whichmotivates *thedecisiontogivethemthesamerepresentation. * *tleSortGroupRefmustmatchressortgrouprefofexactlyoneentryofthe *query'stargetlist;thatistheexpressiontobesortedorgroupedby. *eqopistheOIDoftheequalityoperator. *sortopistheOIDoftheorderingoperator(a"<"or">"operator), *orInvalidOidifnotavailable. *nulls_firstmeansaboutwhatyou'dexpect.IfsortopisInvalidOid *thennulls_firstismeaninglessandshouldbesettofalse. *hashableistrueifeqopishashable(notethisconditionalsodepends *onthedatatypeoftheinputexpression). * *InanORDERBYitem,allfieldsmustbevalid.(Theeqopisn'tessential *here,butit'scheaptogetitalongwiththesortop,andrequiringit *tobevalideasescomparisonstogroupingitems.)Notethatthisisn't *actuallyenoughinformationtodetermineanordering:ifthesortopis *collation-sensitive,acollationOIDisneededtoo.Wedon'tstorethe *collationinSortGroupClausebecauseit'snotavailableatthetimethe *parserbuildstheSortGroupClause;instead,consulttheexposedcollation *ofthereferencedtargetlistexpressiontofindoutwhatitis. * *Inagroupingitem,eqopmustbevalid.Iftheeqopisabtreeequality *operator,thensortopshouldbesettoacompatibleorderingoperator. *Weprefertoseteqop/sortop/nulls_firsttomatchanyORDERBYitemthat *thequerypresentsforthesametlistitem.Ifthereisnone,wejust *usethedefaultorderingopforthedatatype. * *Ifthetlistitem'stypehasahashopclassbutnobtreeopclass,then *wewillseteqoptothehashequalityoperator,sortoptoInvalidOid, *andnulls_firsttofalse.Agroupingitemofthiskindcanonlybe *implementedbyhashing,andofcourseit'llnevermatchanORDERBYitem. * *Thehashableflagisprovidedsincewegenerallyhavetherequisite *informationreadilyavailablewhentheSortGroupClauseisconstructed, *andit'srelativelyexpensivetogetitagainlater.Notethereisno *needfora"sortable"flagsinceOidIsValid(sortop)servesthepurpose. * *AquerymighthavebothORDERBYandDISTINCT(orDISTINCTON)clauses. *InSELECTDISTINCT,thedistinctClauselistisaslongorlongerthanthe *sortClauselist,whileinSELECTDISTINCTONit'stypicallyshorter. *Thetwolistsmustmatchuptotheendoftheshorterone---theparser *rearrangesthedistinctClauseifnecessarytomakethistrue.(This *restrictionensuresthatonlyonesortstepisneededtobothsatisfythe *ORDERBYandsetupfortheUniquestep.Thisissemanticallynecessary *forDISTINCTON,andpresentsnorealdrawbackforDISTINCT.)
*/ typedefstruct SortGroupClause
{
NodeTag type;
Index tleSortGroupRef; /* reference into targetlist */
Oid eqop; /* the equality operator ('=' op) */
Oid sortop; /* the ordering operator ('<' op), or 0 */ bool reverse_sort; /* is sortop a "greater than" operator? */ bool nulls_first; /* do NULLs come before normal values? */ /* can eqop be implemented by hashing? */ bool hashable pg_node_attr(query_jumble_ignore);
} SortGroupClause;
/* *WindowClause- *transformedrepresentationofWINDOWandOVERclauses * *AparsedQuery'swindowClauselistcontainsthesestructs."name"isset *iftheclauseoriginallycamefromWINDOW,andisNULLifitoriginally *wasanOVERclause(butnotethatwecollapseoutduplicateOVERs). *partitionClauseandorderClausearelistsofSortGroupClausestructs. *partitionClauseissanitizedbythequeryplannertoremoveanycolumnsor *expressionsbelongingtoredundantPathKeys. *IfwehaveRANGEwithoffsetPRECEDING/FOLLOWING,thesemanticsofthatare *specifiedbystartInRangeFunc/inRangeColl/inRangeAsc/inRangeNullsFirst *forthestartoffset,orendInRangeFunc/inRange*fortheendoffset. *winrefisanIDnumberreferencedbyWindowFuncnodes;itmustbeunique *amongthemembersofaQuery'swindowClauselist. *Whenrefnameisn'tnull,thepartitionClauseisalwayscopiedfromthere; *theorderClausemightormightnotbecopied(seecopiedOrder);theframing *optionsarenevercopied,perspec. * *Theinformationrelevantforthequeryjumblingisthepartitionclause *typeanditsbounds.
*/ typedefstruct WindowClause
{
NodeTag type; /* window name (NULL in an OVER clause) */ char *name pg_node_attr(query_jumble_ignore); /* referenced window name, if any */ char *refname pg_node_attr(query_jumble_ignore);
List *partitionClause; /* PARTITION BY list */ /* ORDER BY list */
List *orderClause; int frameOptions; /* frame_clause options, see WindowDef */
Node *startOffset; /* expression for starting bound, if any */
Node *endOffset; /* expression for ending bound, if any */ /* in_range function for startOffset */
Oid startInRangeFunc pg_node_attr(query_jumble_ignore); /* in_range function for endOffset */
Oid endInRangeFunc pg_node_attr(query_jumble_ignore); /* collation for in_range tests */
Oid inRangeColl pg_node_attr(query_jumble_ignore); /* use ASC sort order for in_range tests? */ bool inRangeAsc pg_node_attr(query_jumble_ignore); /* nulls sort first for in_range tests? */ bool inRangeNullsFirst pg_node_attr(query_jumble_ignore);
Index winref; /* ID referenced by window functions */ /* did we copy orderClause from refname? */ bool copiedOrder pg_node_attr(query_jumble_ignore);
} WindowClause;
/* *RowMarkClause- *parseroutputrepresentationofFOR[KEY]UPDATE/SHAREclauses * *Query.rowMarkscontainsaseparateRowMarkClausenodeforeachrelation *identifiedasaFOR[KEY]UPDATE/SHAREtarget.Ifoneoftheseclauses *isappliedtoasubquery,wegenerateRowMarkClausesforallnormaland *subqueryrelsinthesubquery,buttheyaremarkedpushedDown=trueto *distinguishthemfromclausesthatwereexplicitlywrittenatthisquery *level.Also,Query.hasForUpdatetellswhethertherewereexplicitFOR *UPDATE/SHARE/KEYSHAREclausesinthecurrentquerylevel.
*/ typedefstruct RowMarkClause
{
NodeTag type;
Index rti; /* range table index of target relation */
LockClauseStrength strength;
LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */ bool pushedDown; /* pushed down from higher query level? */
} RowMarkClause;
/* *WithClause- *representationofWITHclause * *Note:WithClausedoesnotpropagateintotheQueryrepresentation; *butCommonTableExprdoes.
*/ typedefstruct WithClause
{
NodeTag type;
List *ctes; /* list of CommonTableExprs */ bool recursive; /* true = WITH RECURSIVE */
ParseLoc location; /* token location, or -1 if unknown */
} WithClause;
/* *InferClause- *ONCONFLICTuniqueindexinferenceclause * *Note:InferClausedoesnotpropagateintotheQueryrepresentation.
*/ typedefstruct InferClause
{
NodeTag type;
List *indexElems; /* IndexElems to infer unique index */
Node *whereClause; /* qualification (partial-index predicate) */ char *conname; /* Constraint name, or NULL if unnamed */
ParseLoc location; /* token location, or -1 if unknown */
} InferClause;
/* *OnConflictClause- *representationofONCONFLICTclause * *Note:OnConflictClausedoesnotpropagateintotheQueryrepresentation.
*/ typedefstruct OnConflictClause
{
NodeTag type;
OnConflictAction action; /* DO NOTHING or UPDATE? */
InferClause *infer; /* Optional index inference clause */
List *targetList; /* the target list (of ResTarget) */
Node *whereClause; /* qualifications */
ParseLoc location; /* token location, or -1 if unknown */
} OnConflictClause;
typedefstruct CTECycleClause
{
NodeTag type;
List *cycle_col_list; char *cycle_mark_column;
Node *cycle_mark_value;
Node *cycle_mark_default; char *cycle_path_column;
ParseLoc location; /* These fields are set during parse analysis: */
Oid cycle_mark_type; /* common type of _value and _default */ int cycle_mark_typmod;
Oid cycle_mark_collation;
Oid cycle_mark_neop; /* <> operator for type */
} CTECycleClause;
typedefstruct CommonTableExpr
{
NodeTag type;
/* *Queryname(neverqualified).Thestringnameisincludedinthequery *jumblingbecauseRTE_CTERTEsneedit.
*/ char *ctename; /* optional list of column names */
List *aliascolnames pg_node_attr(query_jumble_ignore);
CTEMaterialize ctematerialized; /* is this an optimization fence? */ /* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */
Node *ctequery; /* the CTE's subquery */
CTESearchClause *search_clause pg_node_attr(query_jumble_ignore);
CTECycleClause *cycle_clause pg_node_attr(query_jumble_ignore);
ParseLoc location; /* token location, or -1 if unknown */ /* These fields are set during parse analysis: */ /* is this CTE actually recursive? */ bool cterecursive pg_node_attr(query_jumble_ignore);
/* *NumberofRTEsreferencingthisCTE(excludinginternal *self-references),irrelevantforqueryjumbling.
*/ int cterefcount pg_node_attr(query_jumble_ignore); /* list of output column names */
List *ctecolnames pg_node_attr(query_jumble_ignore); /* OID list of output column type OIDs */
List *ctecoltypes pg_node_attr(query_jumble_ignore); /* integer list of output column typmods */
List *ctecoltypmods pg_node_attr(query_jumble_ignore); /* OID list of column collation OIDs */
List *ctecolcollations pg_node_attr(query_jumble_ignore);
} CommonTableExpr;
/* Convenience macro to get the output tlist of a CTE's query */ #define GetCTETargetList(cte) \
(AssertMacro(IsA((cte)->ctequery, Query)), \
((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \
((Query *) (cte)->ctequery)->targetList : \
((Query *) (cte)->ctequery)->returningList)
/* *MergeWhenClause- *rawparserrepresentationofaWHENclauseinaMERGEstatement * *ThisistransformedintoMergeActionbyparseanalysis
*/ typedefstruct MergeWhenClause
{
NodeTag type;
MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
OverridingKind override; /* OVERRIDING clause */
Node *condition; /* WHEN conditions (raw parser) */
List *targetList; /* INSERT/UPDATE targetlist */ /* the following members are only used in INSERT actions */
List *values; /* VALUES to INSERT, or NULL */
} MergeWhenClause;
/* *ReturningOptionKind- *PossiblekindsofoptioninRETURNINGWITH(...)list * *Currently,thisisusedonlyforspecifyingOLD/NEWaliases.
*/ typedefenum ReturningOptionKind
{
RETURNING_OPTION_OLD, /* specify alias for OLD in RETURNING */
RETURNING_OPTION_NEW, /* specify alias for NEW in RETURNING */
} ReturningOptionKind;
/* *ReturningClause- *ListofRETURNINGexpressions,togetherwithanyWITH(...)options
*/ typedefstruct ReturningClause
{
NodeTag type;
List *options; /* list of ReturningOption elements */
List *exprs; /* list of expressions to return */
} ReturningClause;
/* *JsonTable- *untransformedrepresentationofJSON_TABLE
*/ typedefstruct JsonTable
{
NodeTag type;
JsonValueExpr *context_item; /* context item expression */
JsonTablePathSpec *pathspec; /* JSON path specification */
List *passing; /* list of PASSING clause arguments, if any */
List *columns; /* list of JsonTableColumn */
JsonBehavior *on_error; /* ON ERROR behavior */
Alias *alias; /* table alias in FROM clause */ bool lateral; /* does it have LATERAL prefix? */
ParseLoc location; /* token location, or -1 if unknown */
} JsonTable;
/* *JsonSerializeExpr- *untransformedrepresentationofJSON_SERIALIZE()function
*/ typedefstruct JsonSerializeExpr
{
NodeTag type;
JsonValueExpr *expr; /* json value expression */
JsonOutput *output; /* RETURNING clause, if specified */
ParseLoc location; /* token location, or -1 if unknown */
} JsonSerializeExpr;
/* *JsonObjectConstructor- *untransformedrepresentationofJSON_OBJECT()constructor
*/ typedefstruct JsonObjectConstructor
{
NodeTag type;
List *exprs; /* list of JsonKeyValue pairs */
JsonOutput *output; /* RETURNING clause, if specified */ bool absent_on_null; /* skip NULL values? */ bool unique; /* check key uniqueness? */
ParseLoc location; /* token location, or -1 if unknown */
} JsonObjectConstructor;
/* *JsonArrayConstructor- *untransformedrepresentationofJSON_ARRAY(element,...)constructor
*/ typedefstruct JsonArrayConstructor
{
NodeTag type;
List *exprs; /* list of JsonValueExpr elements */
JsonOutput *output; /* RETURNING clause, if specified */ bool absent_on_null; /* skip NULL elements? */
ParseLoc location; /* token location, or -1 if unknown */
} JsonArrayConstructor;
/* *JsonArrayQueryConstructor- *untransformedrepresentationofJSON_ARRAY(subquery)constructor
*/ typedefstruct JsonArrayQueryConstructor
{
NodeTag type;
Node *query; /* subquery */
JsonOutput *output; /* RETURNING clause, if specified */
JsonFormat *format; /* FORMAT clause for subquery, if specified */ bool absent_on_null; /* skip NULL elements? */
ParseLoc location; /* token location, or -1 if unknown */
} JsonArrayQueryConstructor;
/* *JsonAggConstructor- *commonfieldsofuntransformedrepresentationof *JSON_ARRAYAGG()andJSON_OBJECTAGG()
*/ typedefstruct JsonAggConstructor
{
NodeTag type;
JsonOutput *output; /* RETURNING clause, if any */
Node *agg_filter; /* FILTER clause, if any */
List *agg_order; /* ORDER BY clause, if any */ struct WindowDef *over; /* OVER clause, if any */
ParseLoc location; /* token location, or -1 if unknown */
} JsonAggConstructor;
NodeTag type;
Node *stmt; /* raw parse tree */
ParseLoc stmt_location; /* start location, or -1 if unknown */
ParseLoc stmt_len; /* length in bytes; 0 means "rest of string" */
} RawStmt;
/* *Thesefieldsareusedonlyin"leaf"SelectStmts.
*/
List *distinctClause; /* NULL, list of DISTINCT ON exprs, or
* lcons(NIL,NIL) for all (SELECT DISTINCT) */
IntoClause *intoClause; /* target for SELECT INTO */
List *targetList; /* the target list (of ResTarget) */
List *fromClause; /* the FROM clause */
Node *whereClause; /* WHERE qualification */
List *groupClause; /* GROUP BY clauses */ bool groupDistinct; /* Is this GROUP BY DISTINCT? */
Node *havingClause; /* HAVING conditional-expression */
List *windowClause; /* WINDOW window_name AS (...), ... */
/* *Ina"leaf"noderepresentingaVALUESlist,theabovefieldsareall *null,andinsteadthisfieldisset.Notethattheelementsofthe *sublistsarejustexpressions,withoutResTargetdecoration.Alsonote *thatalistelementcanbeDEFAULT(representedasaSetToDefault *node),regardlessofthecontextoftheVALUESlist.It'suptoparse *analysistorejectthatwherenotvalid.
*/
List *valuesLists; /* untransformed list of expression lists */
/* *Thesefieldsareusedinboth"leaf"SelectStmtsandupper-level *SelectStmts.
*/
List *sortClause; /* sort clause (a list of SortBy's) */
Node *limitOffset; /* # of result tuples to skip */
Node *limitCount; /* # of result tuples to return */
LimitOption limitOption; /* limit type */
List *lockingClause; /* FOR UPDATE (list of LockingClause's) */
WithClause *withClause; /* WITH clause */
/* *Thesefieldsareusedonlyinupper-levelSelectStmts.
*/
SetOperation op; /* type of set op */ bool all; /* ALL specified? */ struct SelectStmt *larg; /* left child */ struct SelectStmt *rarg; /* right child */ /* Eventually add fields for CORRESPONDING spec here */
} SelectStmt;
/* ---------------------- *SetOperationnodeforpost-analysisquerytrees * *Afterparseanalysis,aSELECTwithsetoperationsisrepresentedbya *top-levelQuerynodecontainingtheleafSELECTsassubqueriesinits *rangetable.ItssetOperationsfieldshowsthetreeofsetoperations, *withleafSelectStmtnodesreplacedbyRangeTblRefnodes,andinternal *nodesreplacedbySetOperationStmtnodes.Informationabouttheoutput *columntypesisadded,too.(Notethatthechildnodesdonotnecessarily *producethesetypesdirectly,butwe'vecheckedthattheiroutputtypes *canbecoercedtotheoutputcolumntype.)Also,ifit'snotUNIONALL, *informationaboutthetypes'sort/groupsemanticsisprovidedintheform *ofaSortGroupClauselist(samerepresentationas,eg,DISTINCT). *Theresolvedcommoncolumncollationsareprovidedtoo;butnotethatif *it'snotUNIONALL,it'sokayforacolumntonothaveacommoncollation, *soamemberofthecolCollationslistcouldbeInvalidOideventhoughthe *columnhasacollatabletype. *----------------------
*/ typedefstruct SetOperationStmt
{
NodeTag type;
SetOperation op; /* type of set op */ bool all; /* ALL specified? */
Node *larg; /* left child */
Node *rarg; /* right child */ /* Eventually add fields for CORRESPONDING spec here */
/* Fields derived during parse analysis (irrelevant for query jumbling): */ /* OID list of output column type OIDs */
List *colTypes pg_node_attr(query_jumble_ignore); /* integer list of output column typmods */
List *colTypmods pg_node_attr(query_jumble_ignore); /* OID list of output column collation OIDs */
List *colCollations pg_node_attr(query_jumble_ignore); /* a list of SortGroupClause's */
List *groupClauses pg_node_attr(query_jumble_ignore); /* groupClauses is NIL if UNION ALL, but must be set otherwise */
} SetOperationStmt;
char *name; /* initial column name */
List *indirection; /* subscripts and field names, if any */ int nnames; /* number of names to use in ColumnRef */
SelectStmt *val; /* the PL/pgSQL expression to assign */
ParseLoc location; /* name's token location, or -1 if unknown */
} PLAssignStmt;
/* ---------------------- *CreateSchemaStatement * *NOTE:theschemaEltslistcontainsrawparsetreesforcomponentstatements *oftheschema,suchasCREATETABLE,GRANT,etc.Theseareanalyzedand *executedaftertheschemaitselfiscreated. *----------------------
*/ typedefstruct CreateSchemaStmt
{
NodeTag type; char *schemaname; /* the name of the schema to create */
RoleSpec *authrole; /* the owner of the created schema */
List *schemaElts; /* schema components (list of parsenodes) */ bool if_not_exists; /* just do nothing if schema already exists? */
} CreateSchemaStmt;
typedefenum DropBehavior
{
DROP_RESTRICT, /* drop fails if any dependent objects */
DROP_CASCADE, /* remove dependent objects too */
} DropBehavior;
/* ---------------------- *AlterTable *----------------------
*/ typedefstruct AlterTableStmt
{
NodeTag type;
RangeVar *relation; /* table to work on */
List *cmds; /* list of subcommands */
ObjectType objtype; /* type of object */ bool missing_ok; /* skip error if table missing */
} AlterTableStmt;
typedefenum AlterTableType
{
AT_AddColumn, /* add column */
AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */
AT_ColumnDefault, /* alter column default */
AT_CookedColumnDefault, /* add a pre-cooked column default */
AT_DropNotNull, /* alter column drop not null */
AT_SetNotNull, /* alter column set not null */
AT_SetExpression, /* alter column set expression */
AT_DropExpression, /* alter column drop expression */
AT_SetStatistics, /* alter column set statistics */
AT_SetOptions, /* alter column set ( options ) */
AT_ResetOptions, /* alter column reset ( options ) */
AT_SetStorage, /* alter column set storage */
AT_SetCompression, /* alter column set compression */
AT_DropColumn, /* drop column */
AT_AddIndex, /* add index */
AT_ReAddIndex, /* internal to commands/tablecmds.c */
AT_AddConstraint, /* add constraint */
AT_ReAddConstraint, /* internal to commands/tablecmds.c */
AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
AT_AlterConstraint, /* alter constraint */
AT_ValidateConstraint, /* validate constraint */
AT_AddIndexConstraint, /* add constraint using existing index */
AT_DropConstraint, /* drop constraint */
AT_ReAddComment, /* internal to commands/tablecmds.c */
AT_AlterColumnType, /* alter column type */
AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
AT_ChangeOwner, /* change owner */
AT_ClusterOn, /* CLUSTER ON */
AT_DropCluster, /* SET WITHOUT CLUSTER */
AT_SetLogged, /* SET LOGGED */
AT_SetUnLogged, /* SET UNLOGGED */
AT_DropOids, /* SET WITHOUT OIDS */
AT_SetAccessMethod, /* SET ACCESS METHOD */
AT_SetTableSpace, /* SET TABLESPACE */
AT_SetRelOptions, /* SET (...) -- AM specific parameters */
AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */
AT_ReplaceRelOptions, /* replace reloption list in its entirety */
AT_EnableTrig, /* ENABLE TRIGGER name */
AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */
AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */
AT_DisableTrig, /* DISABLE TRIGGER name */
AT_EnableTrigAll, /* ENABLE TRIGGER ALL */
AT_DisableTrigAll, /* DISABLE TRIGGER ALL */
AT_EnableTrigUser, /* ENABLE TRIGGER USER */
AT_DisableTrigUser, /* DISABLE TRIGGER USER */
AT_EnableRule, /* ENABLE RULE name */
AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */
AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */
AT_DisableRule, /* DISABLE RULE name */
AT_AddInherit, /* INHERIT parent */
AT_DropInherit, /* NO INHERIT parent */
AT_AddOf, /* OF <type_name> */
AT_DropOf, /* NOT OF */
AT_ReplicaIdentity, /* REPLICA IDENTITY */
AT_EnableRowSecurity, /* ENABLE ROW SECURITY */
AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
AT_ForceRowSecurity, /* FORCE ROW SECURITY */
AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
AT_GenericOptions, /* OPTIONS (...) */
AT_AttachPartition, /* ATTACH PARTITION */
AT_DetachPartition, /* DETACH PARTITION */
AT_DetachPartitionFinalize, /* DETACH PARTITION FINALIZE */
AT_AddIdentity, /* ADD IDENTITY */
AT_SetIdentity, /* SET identity column options */
AT_DropIdentity, /* DROP IDENTITY */
AT_ReAddStatistics, /* internal to commands/tablecmds.c */
} AlterTableType;
typedefstruct AlterTableCmd /* one subcommand of an ALTER TABLE */
{
NodeTag type;
AlterTableType subtype; /* Type of table alteration to apply */ char *name; /* column, constraint, or trigger to act on,
* or tablespace, access method */
int16 num; /* attribute number for columns referenced by
* number */
RoleSpec *newowner;
Node *def; /* definition of new column, index,
* constraint, or parent table */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ bool missing_ok; /* skip error if missing? */ bool recurse; /* exec-time recursion */
} AlterTableCmd;
/* ---------------------- *AlterDomain * *Thefieldsareusedindifferentwaysbythedifferentvariantsof *thiscommand. *----------------------
*/ typedefstruct AlterDomainStmt
{
NodeTag type; char subtype; /*------------ *T=altercolumndefault *N=altercolumndropnotnull *O=altercolumnsetnotnull *C=addconstraint *X=dropconstraint *------------
*/
List *typeName; /* domain to work on */ char *name; /* column or constraint name to act on */
Node *def; /* definition of default or constraint */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ bool missing_ok; /* skip error if missing? */
} AlterDomainStmt;
/* ---------------------- *Grant|RevokeStatement *----------------------
*/ typedefenum GrantTargetType
{
ACL_TARGET_OBJECT, /* grant on specific named object(s) */
ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */
} GrantTargetType;
typedefstruct GrantStmt
{
NodeTag type; bool is_grant; /* true = GRANT, false = REVOKE */
GrantTargetType targtype; /* type of the grant target */
ObjectType objtype; /* kind of object being operated on */
List *objects; /* list of RangeVar nodes, ObjectWithArgs
* nodes, or plain names (as String values) */
List *privileges; /* list of AccessPriv nodes */ /* privileges == NIL denotes ALL PRIVILEGES */
List *grantees; /* list of RoleSpec nodes */ bool grant_option; /* grant or revoke grant option */
RoleSpec *grantor;
DropBehavior behavior; /* drop behavior (for REVOKE) */
} GrantStmt;
/* *ObjectWithArgsrepresentsafunction/procedure/operatornameplusparameter *identification. * *objargsincludesonlythetypesoftheinputparametersoftheobject. *Insomecontexts,thatwillbeallwehave,andit'senoughtolookup *objectsaccordingtothetraditionalPostgresrules(i.e.,whenonlyinput *argumentsmatter). * *objfuncargs,ifnotNIL,carriesthefullspecificationoftheparameter *list,includingparametermodeannotations. * *Somegrammarproductionscansetargs_unspecified=trueinsteadof *providingparameterinfo.Inthiscase,lookupwillsucceedonlyif *theobjectnameisunique.Notethatotherwise,NILparameterlists *meanzeroarguments.
*/ typedefstruct ObjectWithArgs
{
NodeTag type;
List *objname; /* qualified name of function/operator */
List *objargs; /* list of Typename nodes (input args only) */
List *objfuncargs; /* list of FunctionParameter nodes */ bool args_unspecified; /* argument list was omitted? */
} ObjectWithArgs;
/* *Anaccessprivilege,withoptionallistofcolumnnames *priv_name==NULLdenotesALLPRIVILEGES(onlyusedwithacolumnlist) *cols==NILdenotes"allcolumns" *Notethatsimple"ALLPRIVILEGES"isrepresentedasaNILlist,not *anAccessPrivwithbothfieldsnull.
*/ typedefstruct AccessPriv
{
NodeTag type; char *priv_name; /* string name of privilege */
List *cols; /* list of String */
} AccessPriv;
/* ---------------------- *Grant/RevokeRoleStatement * *Note:becauseoftheparsingambiguitywiththeGRANT<privileges> *statement,granted_rolesisalistofAccessPriv;theexecutioncode *shouldcomplainifanycolumnlistsappear.grantee_rolesisalist *ofrolenames,asStringvalues. *----------------------
*/ typedefstruct GrantRoleStmt
{
NodeTag type;
List *granted_roles; /* list of roles to be granted/revoked */
List *grantee_roles; /* list of member roles to add/delete */ bool is_grant; /* true = GRANT, false = REVOKE */
List *opt; /* options e.g. WITH GRANT OPTION */
RoleSpec *grantor; /* set grantor to other than current role */
DropBehavior behavior; /* drop behavior (for REVOKE) */
} GrantRoleStmt;
/* ---------------------- *AlterDefaultPrivilegesStatement *----------------------
*/ typedefstruct AlterDefaultPrivilegesStmt
{
NodeTag type;
List *options; /* list of DefElem */
GrantStmt *action; /* GRANT/REVOKE action (with objects=NIL) */
} AlterDefaultPrivilegesStmt;
/* ---------------------- *CopyStatement * *Wesupport"COPYrelationFROMfile","COPYrelationTOfile",and *"COPY(query)TOfile".InanygivenCopyStmt,exactlyoneof"relation" *and"query"mustbenon-NULL. *----------------------
*/ typedefstruct CopyStmt
{
NodeTag type;
RangeVar *relation; /* the relation to copy */
Node *query; /* the query (SELECT or DML statement with
* RETURNING) to copy, as a raw parse tree */
List *attlist; /* List of column names (as Strings), or NIL
* for all columns */ bool is_from; /* TO or FROM */ bool is_program; /* is 'filename' a program to popen? */ char *filename; /* filename, or NULL for STDIN/STDOUT */
List *options; /* List of DefElem nodes */
Node *whereClause; /* WHERE condition (or NULL) */
} CopyStmt;
/* ---------------------- *SETStatement(includesRESET) * *"SETvarTODEFAULT"and"RESETvar"aresemanticallyequivalent,butwe *preservethedistinctioninVariableSetKindforCreateCommandTag(). *----------------------
*/ typedefenum VariableSetKind
{
VAR_SET_VALUE, /* SET var = value */
VAR_SET_DEFAULT, /* SET var TO DEFAULT */
VAR_SET_CURRENT, /* SET var FROM CURRENT */
VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
VAR_RESET, /* RESET var */
VAR_RESET_ALL, /* RESET ALL */
} VariableSetKind;
typedefstruct CreateStmt
{
NodeTag type;
RangeVar *relation; /* relation to create */
List *tableElts; /* column definitions (list of ColumnDef) */
List *inhRelations; /* relations to inherit from (list of
* RangeVar) */
PartitionBoundSpec *partbound; /* FOR VALUES clause */
PartitionSpec *partspec; /* PARTITION BY clause */ TypeName *ofTypename; /* OF typename */
List *constraints; /* constraints (list of Constraint nodes) */
List *nnconstraints; /* NOT NULL constraints (ditto) */
List *options; /* options from WITH clause */
OnCommitAction oncommit; /* what do we do at COMMIT? */ char *tablespacename; /* table space to use, or NULL */ char *accessMethod; /* table access method */ bool if_not_exists; /* just do nothing if it already exists? */
} CreateStmt;
typedefenum ConstrType /* types of constraints */
{
CONSTR_NULL, /* not standard SQL, but a lot of people
* expect it */
CONSTR_NOTNULL,
CONSTR_DEFAULT,
CONSTR_IDENTITY,
CONSTR_GENERATED,
CONSTR_CHECK,
CONSTR_PRIMARY,
CONSTR_UNIQUE,
CONSTR_EXCLUSION,
CONSTR_FOREIGN,
CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
CONSTR_ATTR_NOT_DEFERRABLE,
CONSTR_ATTR_DEFERRED,
CONSTR_ATTR_IMMEDIATE,
CONSTR_ATTR_ENFORCED,
CONSTR_ATTR_NOT_ENFORCED,
} ConstrType;
typedefstruct Constraint
{
NodeTag type;
ConstrType contype; /* see above */ char *conname; /* Constraint name, or NULL if unnamed */ bool deferrable; /* DEFERRABLE? */ bool initdeferred; /* INITIALLY DEFERRED? */ bool is_enforced; /* enforced constraint? */ bool skip_validation; /* skip validation of existing rows? */ bool initially_valid; /* mark the new constraint as valid? */ bool is_no_inherit; /* is constraint non-inheritable? */
Node *raw_expr; /* CHECK or DEFAULT expression, as
* untransformed parse tree */ char *cooked_expr; /* CHECK or DEFAULT expression, as
* nodeToString representation */ char generated_when; /* ALWAYS or BY DEFAULT */ char generated_kind; /* STORED or VIRTUAL */ bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
List *keys; /* String nodes naming referenced key
* column(s); for UNIQUE/PK/NOT NULL */ bool without_overlaps; /* WITHOUT OVERLAPS specified */
List *including; /* String nodes naming referenced nonkey
* column(s); for UNIQUE/PK */
List *exclusions; /* list of (IndexElem, operator name) pairs;
* for exclusion constraints */
List *options; /* options from WITH clause */ char *indexname; /* existing index to use; otherwise NULL */ char *indexspace; /* index tablespace; NULL for default */ bool reset_default_tblspc; /* reset default_tablespace prior to
* creating the index */ char *access_method; /* index access method; NULL for default */
Node *where_clause; /* partial index predicate */
/* Fields used for FOREIGN KEY constraints: */
RangeVar *pktable; /* Primary key table */
List *fk_attrs; /* Attributes of foreign key */
List *pk_attrs; /* Corresponding attrs in PK table */ bool fk_with_period; /* Last attribute of FK uses PERIOD */ bool pk_with_period; /* Last attribute of PK uses PERIOD */ char fk_matchtype; /* FULL, PARTIAL, SIMPLE */ char fk_upd_action; /* ON UPDATE action */ char fk_del_action; /* ON DELETE action */
List *fk_del_set_cols; /* ON DELETE SET NULL/DEFAULT (col1, col2) */
List *old_conpfeqop; /* pg_constraint.conpfeqop of my former self */
Oid old_pktable_oid; /* pg_constraint.confrelid of my former
* self */
ParseLoc location; /* token location, or -1 if unknown */
} Constraint;
typedefstruct AlterTableMoveAllStmt
{
NodeTag type; char *orig_tablespacename;
ObjectType objtype; /* Object type to move */
List *roles; /* List of roles to move objects of */ char *new_tablespacename; bool nowait;
} AlterTableMoveAllStmt;
typedefstruct CreateExtensionStmt
{
NodeTag type; char *extname; bool if_not_exists; /* just do nothing if it already exists? */
List *options; /* List of DefElem nodes */
} CreateExtensionStmt;
/* Only used for ALTER EXTENSION UPDATE; later might need an action field */ typedefstruct AlterExtensionStmt
{
NodeTag type; char *extname;
List *options; /* List of DefElem nodes */
} AlterExtensionStmt;
typedefstruct AlterExtensionContentsStmt
{
NodeTag type; char *extname; /* Extension's name */ int action; /* +1 = add object, -1 = drop object */
ObjectType objtype; /* Object's type */
Node *object; /* Qualified name of the object */
} AlterExtensionContentsStmt;
typedefstruct CreateForeignServerStmt
{
NodeTag type; char *servername; /* server name */ char *servertype; /* optional server type */ char *version; /* optional server version */ char *fdwname; /* FDW name */ bool if_not_exists; /* just do nothing if it already exists? */
List *options; /* generic options to server */
} CreateForeignServerStmt;
typedefstruct AlterForeignServerStmt
{
NodeTag type; char *servername; /* server name */ char *version; /* optional server version */
List *options; /* generic options to server */ bool has_version; /* version specified */
} AlterForeignServerStmt;
typedefstruct CreateUserMappingStmt
{
NodeTag type;
RoleSpec *user; /* user role */ char *servername; /* server name */ bool if_not_exists; /* just do nothing if it already exists? */
List *options; /* generic options to server */
} CreateUserMappingStmt;
typedefstruct AlterUserMappingStmt
{
NodeTag type;
RoleSpec *user; /* user role */ char *servername; /* server name */
List *options; /* generic options to server */
} AlterUserMappingStmt;
typedefstruct DropUserMappingStmt
{
NodeTag type;
RoleSpec *user; /* user role */ char *servername; /* server name */ bool missing_ok; /* ignore missing mappings */
} DropUserMappingStmt;
typedefenum ImportForeignSchemaType
{
FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */
} ImportForeignSchemaType;
typedefstruct ImportForeignSchemaStmt
{
NodeTag type; char *server_name; /* FDW server name */ char *remote_schema; /* remote schema name to query */ char *local_schema; /* local schema to create objects in */
ImportForeignSchemaType list_type; /* type of table list */
List *table_list; /* List of RangeVar */
List *options; /* list of options to pass to FDW */
} ImportForeignSchemaStmt;
/*---------------------- *CreatePOLICYStatement *----------------------
*/ typedefstruct CreatePolicyStmt
{
NodeTag type; char *policy_name; /* Policy's name */
RangeVar *table; /* the table name the policy applies to */ char *cmd_name; /* the command name the policy applies to */ bool permissive; /* restrictive or permissive policy */
List *roles; /* the roles associated with the policy */
Node *qual; /* the policy's condition */
Node *with_check; /* the policy's WITH CHECK condition. */
} CreatePolicyStmt;
/*---------------------- *AlterPOLICYStatement *----------------------
*/ typedefstruct AlterPolicyStmt
{
NodeTag type; char *policy_name; /* Policy's name */
RangeVar *table; /* the table name the policy applies to */
List *roles; /* the roles associated with the policy */
Node *qual; /* the policy's condition */
Node *with_check; /* the policy's WITH CHECK condition. */
} AlterPolicyStmt;
/*---------------------- *CreateACCESSMETHODStatement *----------------------
*/ typedefstruct CreateAmStmt
{
NodeTag type; char *amname; /* access method name */
List *handler_name; /* handler function name */ char amtype; /* type of access method */
} CreateAmStmt;
/* ---------------------- *CreateTRIGGERStatement *----------------------
*/ typedefstruct CreateTrigStmt
{
NodeTag type; bool replace; /* replace trigger if already exists */ bool isconstraint; /* This is a constraint trigger */ char *trigname; /* TRIGGER's name */
RangeVar *relation; /* relation trigger is on */
List *funcname; /* qual. name of function to call */
List *args; /* list of String or NIL */ bool row; /* ROW/STATEMENT */ /* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
int16 timing; /* BEFORE, AFTER, or INSTEAD */ /* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
int16 events; /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */
List *columns; /* column names, or NIL for all columns */
Node *whenClause; /* qual expression, or NULL if none */ /* explicitly named transition data */
List *transitionRels; /* TriggerTransition nodes, or NIL if none */ /* The remaining fields are only used for constraint triggers */ bool deferrable; /* [NOT] DEFERRABLE */ bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
RangeVar *constrrel; /* opposite relation, if RI trigger */
} CreateTrigStmt;
/* ---------------------- *CreateEVENTTRIGGERStatement *----------------------
*/ typedefstruct CreateEventTrigStmt
{
NodeTag type; char *trigname; /* TRIGGER's name */ char *eventname; /* event's identifier */
List *whenclause; /* list of DefElems indicating filtering */
List *funcname; /* qual. name of function to call */
} CreateEventTrigStmt;
typedefstruct CreateRoleStmt
{
NodeTag type;
RoleStmtType stmt_type; /* ROLE/USER/GROUP */ char *role; /* role name */
List *options; /* List of DefElem nodes */
} CreateRoleStmt;
typedefstruct AlterRoleStmt
{
NodeTag type;
RoleSpec *role; /* role */
List *options; /* List of DefElem nodes */ int action; /* +1 = add members, -1 = drop members */
} AlterRoleStmt;
typedefstruct AlterRoleSetStmt
{
NodeTag type;
RoleSpec *role; /* role */ char *database; /* database name, or NULL */
VariableSetStmt *setstmt; /* SET or RESET subcommand */
} AlterRoleSetStmt;
typedefstruct DropRoleStmt
{
NodeTag type;
List *roles; /* List of roles to remove */ bool missing_ok; /* skip error if a role is missing? */
} DropRoleStmt;
typedefstruct CreateSeqStmt
{
NodeTag type;
RangeVar *sequence; /* the sequence to create */
List *options;
Oid ownerId; /* ID of owner, or InvalidOid for default */ bool for_identity; bool if_not_exists; /* just do nothing if it already exists? */
} CreateSeqStmt;
typedefstruct AlterSeqStmt
{
NodeTag type;
RangeVar *sequence; /* the sequence to alter */
List *options; bool for_identity; bool missing_ok; /* skip error if a role is missing? */
} AlterSeqStmt;
/* ---------------------- *Create{Aggregate|Operator|Type}Statement *----------------------
*/ typedefstruct DefineStmt
{
NodeTag type;
ObjectType kind; /* aggregate, operator, type */ bool oldstyle; /* hack to signal old CREATE AGG syntax */
List *defnames; /* qualified name (list of String) */
List *args; /* a list of TypeName (if needed) */
List *definition; /* a list of DefElem */ bool if_not_exists; /* just do nothing if it already exists? */ bool replace; /* replace if already exists? */
} DefineStmt;
/* ---------------------- *CreateDomainStatement *----------------------
*/ typedefstruct CreateDomainStmt
{
NodeTag type;
List *domainname; /* qualified name (list of String) */ TypeName *typeName; /* the base type */
CollateClause *collClause; /* untransformed COLLATE spec, if any */
List *constraints; /* constraints (list of Constraint nodes) */
} CreateDomainStmt;
/* ---------------------- *CreateOperatorClassStatement *----------------------
*/ typedefstruct CreateOpClassStmt
{
NodeTag type;
List *opclassname; /* qualified name (list of String) */
List *opfamilyname; /* qualified name (ditto); NIL if omitted */ char *amname; /* name of index AM opclass is for */ TypeName *datatype; /* datatype of indexed column */
List *items; /* List of CreateOpClassItem nodes */ bool isDefault; /* Should be marked as default for type? */
} CreateOpClassStmt;
typedefstruct CreateOpClassItem
{
NodeTag type; int itemtype; /* see codes above */
ObjectWithArgs *name; /* operator or function name and args */ int number; /* strategy num or support proc num */
List *order_family; /* only used for ordering operators */
List *class_args; /* amproclefttype/amprocrighttype or
* amoplefttype/amoprighttype */ /* fields used for a storagetype item: */ TypeName *storedtype; /* datatype stored in index */
} CreateOpClassItem;
/* ---------------------- *CreateOperatorFamilyStatement *----------------------
*/ typedefstruct CreateOpFamilyStmt
{
NodeTag type;
List *opfamilyname; /* qualified name (list of String) */ char *amname; /* name of index AM opfamily is for */
} CreateOpFamilyStmt;
/* ---------------------- *AlterOperatorFamilyStatement *----------------------
*/ typedefstruct AlterOpFamilyStmt
{
NodeTag type;
List *opfamilyname; /* qualified name (list of String) */ char *amname; /* name of index AM opfamily is for */ bool isDrop; /* ADD or DROP the items? */
List *items; /* List of CreateOpClassItem nodes */
} AlterOpFamilyStmt;
typedefstruct DropStmt
{
NodeTag type;
List *objects; /* list of names */
ObjectType removeType; /* object type */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if object is missing? */ bool concurrent; /* drop index concurrently? */
} DropStmt;
/* ---------------------- *TruncateTableStatement *----------------------
*/ typedefstruct TruncateStmt
{
NodeTag type;
List *relations; /* relations (RangeVars) to be truncated */ bool restart_seqs; /* restart owned sequences? */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
} TruncateStmt;
/* ---------------------- *CommentOnStatement *----------------------
*/ typedefstruct CommentStmt
{
NodeTag type;
ObjectType objtype; /* Object's type */
Node *object; /* Qualified name of the object */ char *comment; /* Comment to insert, or NULL to remove */
} CommentStmt;
/* ---------------------- *SECURITYLABELStatement *----------------------
*/ typedefstruct SecLabelStmt
{
NodeTag type;
ObjectType objtype; /* Object's type */
Node *object; /* Qualified name of the object */ char *provider; /* Label provider (or NULL) */ char *label; /* New security label to be assigned */
} SecLabelStmt;
/* ---------------------- *DeclareCursorStatement * *The"query"fieldisinitiallyarawparsetree,andisconvertedtoa *Querynodeduringparseanalysis.Notethatrewritingandplanning *ofthequeryarealwayspostponeduntilexecution. *----------------------
*/ #define CURSOR_OPT_BINARY 0x0001 /* BINARY */ #define CURSOR_OPT_SCROLL 0x0002 /* SCROLL explicitly given */ #define CURSOR_OPT_NO_SCROLL 0x0004 /* NO SCROLL explicitly given */ #define CURSOR_OPT_INSENSITIVE 0x0008 /* INSENSITIVE */ #define CURSOR_OPT_ASENSITIVE 0x0010 /* ASENSITIVE */ #define CURSOR_OPT_HOLD 0x0020 /* WITH HOLD */ /* these planner-control flags do not correspond to any SQL grammar: */ #define CURSOR_OPT_FAST_PLAN 0x0100 /* prefer fast-start plan */ #define CURSOR_OPT_GENERIC_PLAN 0x0200 /* force use of generic plan */ #define CURSOR_OPT_CUSTOM_PLAN 0x0400 /* force use of custom plan */ #define CURSOR_OPT_PARALLEL_OK 0x0800 /* parallel mode OK */
typedefstruct DeclareCursorStmt
{
NodeTag type; char *portalname; /* name of the portal (cursor) */ int options; /* bitmask of options (see above) */
Node *query; /* the query (see comments above) */
} DeclareCursorStmt;
/* ---------------------- *ClosePortalStatement *----------------------
*/ typedefstruct ClosePortalStmt
{
NodeTag type; char *portalname; /* name of the portal (cursor) */ /* NULL means CLOSE ALL */
} ClosePortalStmt;
/* ---------------------- *FetchStatement(alsoMove) *----------------------
*/ typedefenum FetchDirection
{ /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
FETCH_FORWARD,
FETCH_BACKWARD, /* for these, howMany indicates a position; only one row is fetched */
FETCH_ABSOLUTE,
FETCH_RELATIVE,
} FetchDirection;
#define FETCH_ALL LONG_MAX
typedefstruct FetchStmt
{
NodeTag type;
FetchDirection direction; /* see above */ long howMany; /* number of rows, or position argument */ char *portalname; /* name of portal (cursor) */ bool ismove; /* true if MOVE */
} FetchStmt;
/* ---------------------- *CreateIndexStatement * *Thisrepresentscreationofanindexand/oranassociatedconstraint. *Ifisconstraintistrue,weshouldcreateapg_constraintentryalong *withtheindex.ButifindexOidisn'tInvalidOid,wearenotcreatingan *index,justaUNIQUE/PKEYconstraintusinganexistingindex.isconstraint *mustalwaysbetrueinthiscase,andthefieldsdescribingtheindex *propertiesareempty. *----------------------
*/ typedefstruct IndexStmt
{
NodeTag type; char *idxname; /* name of new index, or NULL for default */
RangeVar *relation; /* relation to build index on */ char *accessMethod; /* name of access method (eg. btree) */ char *tableSpace; /* tablespace, or NULL for default */
List *indexParams; /* columns to index: a list of IndexElem */
List *indexIncludingParams; /* additional columns to index: a list
* of IndexElem */
List *options; /* WITH clause options: a list of DefElem */
Node *whereClause; /* qualification (partial-index predicate) */
List *excludeOpNames; /* exclusion operator names, or NIL if none */ char *idxcomment; /* comment to apply to index, or NULL */
Oid indexOid; /* OID of an existing index, if any */
RelFileNumber oldNumber; /* relfilenumber of existing storage, if any */
SubTransactionId oldCreateSubid; /* rd_createSubid of oldNumber */
SubTransactionId oldFirstRelfilelocatorSubid; /* rd_firstRelfilelocatorSubid
* of oldNumber */ bool unique; /* is index unique? */ bool nulls_not_distinct; /* null treatment for UNIQUE constraints */ bool primary; /* is index a primary key? */ bool isconstraint; /* is it for a pkey/unique constraint? */ bool iswithoutoverlaps; /* is the constraint WITHOUT OVERLAPS? */ bool deferrable; /* is the constraint DEFERRABLE? */ bool initdeferred; /* is the constraint INITIALLY DEFERRED? */ bool transformed; /* true when transformIndexStmt is finished */ bool concurrent; /* should this be a concurrent index build? */ bool if_not_exists; /* just do nothing if index already exists? */ bool reset_default_tblspc; /* reset default_tablespace prior to
* executing */
} IndexStmt;
/* ---------------------- *CreateStatisticsStatement *----------------------
*/ typedefstruct CreateStatsStmt
{
NodeTag type;
List *defnames; /* qualified name (list of String) */
List *stat_types; /* stat types (list of String) */
List *exprs; /* expressions to build statistics on */
List *relations; /* rels to build stats on (list of RangeVar) */ char *stxcomment; /* comment to apply to stats, or NULL */ bool transformed; /* true when transformStatsStmt is finished */ bool if_not_exists; /* do nothing if stats name already exists */
} CreateStatsStmt;
/* *StatsElem-statisticsparameters(usedinCREATESTATISTICS) * *Foraplainattribute,'name'isthenameofthereferencedtablecolumn *and'expr'isNULL.Foranexpression,'name'isNULLand'expr'isthe *expressiontree.
*/ typedefstruct StatsElem
{
NodeTag type; char *name; /* name of attribute to index, or NULL */
Node *expr; /* expression to index, or NULL */
} StatsElem;
/* ---------------------- *AlterStatisticsStatement *----------------------
*/ typedefstruct AlterStatsStmt
{
NodeTag type;
List *defnames; /* qualified name (list of String) */
Node *stxstattarget; /* statistics target */ bool missing_ok; /* skip error if statistics object is missing */
} AlterStatsStmt;
/* ---------------------- *CreateFunctionStatement *----------------------
*/ typedefstruct CreateFunctionStmt
{
NodeTag type; bool is_procedure; /* it's really CREATE PROCEDURE */ bool replace; /* T => replace if already exists */
List *funcname; /* qualified name of function to create */
List *parameters; /* a list of FunctionParameter */ TypeName *returnType; /* the return type */
List *options; /* a list of DefElem */
Node *sql_body;
} CreateFunctionStmt;
typedefenum FunctionParameterMode
{ /* the assigned enum values appear in pg_proc, don't change 'em! */
FUNC_PARAM_IN = 'i', /* input only */
FUNC_PARAM_OUT = 'o', /* output only */
FUNC_PARAM_INOUT = 'b', /* both */
FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
FUNC_PARAM_TABLE = 't', /* table function output column */ /* this is not used in pg_proc: */
FUNC_PARAM_DEFAULT = 'd', /* default; effectively same as IN */
} FunctionParameterMode;
typedefstruct FunctionParameter
{
NodeTag type; char *name; /* parameter name, or NULL if not given */ TypeName *argType; /* TypeName for parameter type */
FunctionParameterMode mode; /* IN/OUT/etc */
Node *defexpr; /* raw default expr, or NULL if not given */
ParseLoc location; /* token location, or -1 if unknown */
} FunctionParameter;
typedefstruct AlterFunctionStmt
{
NodeTag type;
ObjectType objtype;
ObjectWithArgs *func; /* name and args of function */
List *actions; /* list of DefElem */
} AlterFunctionStmt;
/* ---------------------- *DOStatement * *DoStmtistherawparseroutput,InlineCodeBlockistheexecution-timeAPI *----------------------
*/ typedefstruct DoStmt
{
NodeTag type;
List *args; /* List of DefElem nodes */
} DoStmt;
typedefstruct InlineCodeBlock
{
pg_node_attr(nodetag_only) /* this is not a member of parse trees */
NodeTag type; char *source_text; /* source text of anonymous code block */
Oid langOid; /* OID of selected language */ bool langIsTrusted; /* trusted property of the language */ bool atomic; /* atomic execution context */
} InlineCodeBlock;
/* ---------------------- *CALLstatement * *OUT-modeargumentsareremovedfromthetransformedfuncexpr.Theoutargs *listcontainscopiesoftheexpressionsforalloutputarguments,inthe *orderoftheprocedure'sdeclaredarguments.(outargsisneverevaluated, *butisusefultothecallerasareferenceforwhattoassignto.) *Thetransformedcallstateisnotrelevantinthequeryjumbling,onlythe *functioncallis. *----------------------
*/ typedefstruct CallStmt
{
NodeTag type; /* from the parser */
FuncCall *funccall pg_node_attr(query_jumble_ignore); /* transformed call, with only input args */
FuncExpr *funcexpr; /* transformed output-argument expressions */
List *outargs;
} CallStmt;
typedefstruct CallContext
{
pg_node_attr(nodetag_only) /* this is not a member of parse trees */
NodeTag type; bool atomic;
} CallContext;
/* ---------------------- *AlterObjectRenameStatement *----------------------
*/ typedefstruct RenameStmt
{
NodeTag type;
ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
ObjectType relationType; /* if column name, associated relation type */
RangeVar *relation; /* in case it's a table */
Node *object; /* in case it's some other object */ char *subname; /* name of contained object (column, rule,
* trigger, etc) */ char *newname; /* the new name */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if missing? */
} RenameStmt;
/* ---------------------- *ALTERobjectDEPENDSONEXTENSIONextname *----------------------
*/ typedefstruct AlterObjectDependsStmt
{
NodeTag type;
ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
RangeVar *relation; /* in case a table is involved */
Node *object; /* name of the object */
String *extname; /* extension name */ bool remove; /* set true to remove dep rather than add */
} AlterObjectDependsStmt;
/* ---------------------- *ALTERobjectSETSCHEMAStatement *----------------------
*/ typedefstruct AlterObjectSchemaStmt
{
NodeTag type;
ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
RangeVar *relation; /* in case it's a table */
Node *object; /* in case it's some other object */ char *newschema; /* the new schema */ bool missing_ok; /* skip error if missing? */
} AlterObjectSchemaStmt;
/* ---------------------- *AlterObjectOwnerStatement *----------------------
*/ typedefstruct AlterOwnerStmt
{
NodeTag type;
ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
RangeVar *relation; /* in case it's a table */
Node *object; /* in case it's some other object */
RoleSpec *newowner; /* the new owner */
} AlterOwnerStmt;
/* ---------------------- *AlterOperatorSet(this-n-that) *----------------------
*/ typedefstruct AlterOperatorStmt
{
NodeTag type;
ObjectWithArgs *opername; /* operator name and argument types */
List *options; /* List of DefElem nodes */
} AlterOperatorStmt;
/* ------------------------ *AlterTypeSet(this-n-that) *------------------------
*/ typedefstruct AlterTypeStmt
{
NodeTag type;
List *typeName; /* type name (possibly qualified) */
List *options; /* List of DefElem nodes */
} AlterTypeStmt;
/* ---------------------- *CreateRuleStatement *----------------------
*/ typedefstruct RuleStmt
{
NodeTag type;
RangeVar *relation; /* relation the rule is for */ char *rulename; /* name of the rule */
Node *whereClause; /* qualifications */
CmdType event; /* SELECT, INSERT, etc */ bool instead; /* is a 'do instead'? */
List *actions; /* the action statements */ bool replace; /* OR REPLACE */
} RuleStmt;
/* ---------------------- *NotifyStatement *----------------------
*/ typedefstruct NotifyStmt
{
NodeTag type; char *conditionname; /* condition name to notify */ char *payload; /* the payload string, or NULL if none */
} NotifyStmt;
/* ---------------------- *ListenStatement *----------------------
*/ typedefstruct ListenStmt
{
NodeTag type; char *conditionname; /* condition name to listen on */
} ListenStmt;
/* ---------------------- *UnlistenStatement *----------------------
*/ typedefstruct UnlistenStmt
{
NodeTag type; char *conditionname; /* name to unlisten on, or NULL for all */
} UnlistenStmt;
typedefstruct TransactionStmt
{
NodeTag type;
TransactionStmtKind kind; /* see above */
List *options; /* for BEGIN/START commands */ /* for savepoint commands */ char *savepoint_name pg_node_attr(query_jumble_ignore); /* for two-phase-commit related commands */ char *gid pg_node_attr(query_jumble_ignore); bool chain; /* AND CHAIN option */ /* token location, or -1 if unknown */
ParseLoc location pg_node_attr(query_jumble_location);
} TransactionStmt;
/* ---------------------- *CreateTypeStatement,compositetypes *----------------------
*/ typedefstruct CompositeTypeStmt
{
NodeTag type;
RangeVar *typevar; /* the composite type to be created */
List *coldeflist; /* list of ColumnDef nodes */
} CompositeTypeStmt;
/* ---------------------- *CreateTypeStatement,enumtypes *----------------------
*/ typedefstruct CreateEnumStmt
{
NodeTag type;
List *typeName; /* qualified name (list of String) */
List *vals; /* enum values (list of String) */
} CreateEnumStmt;
/* ---------------------- *CreateTypeStatement,rangetypes *----------------------
*/ typedefstruct CreateRangeStmt
{
NodeTag type;
List *typeName; /* qualified name (list of String) */
List *params; /* range parameters (list of DefElem) */
} CreateRangeStmt;
/* ---------------------- *AlterTypeStatement,enumtypes *----------------------
*/ typedefstruct AlterEnumStmt
{
NodeTag type;
List *typeName; /* qualified name (list of String) */ char *oldVal; /* old enum value's name, if renaming */ char *newVal; /* new enum value's name */ char *newValNeighbor; /* neighboring enum value, if specified */ bool newValIsAfter; /* place new enum value after neighbor? */ bool skipIfNewValExists; /* no error if new already exists? */
} AlterEnumStmt;
typedefstruct ViewStmt
{
NodeTag type;
RangeVar *view; /* the view to be created */
List *aliases; /* target column names */
Node *query; /* the SELECT query (as a raw parse tree) */ bool replace; /* replace an existing view? */
List *options; /* options from WITH clause */
ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
} ViewStmt;
/* ---------------------- *CreatedbStatement *----------------------
*/ typedefstruct CreatedbStmt
{
NodeTag type; char *dbname; /* name of database to create */
List *options; /* List of DefElem nodes */
} CreatedbStmt;
/* ---------------------- *AlterDatabase *----------------------
*/ typedefstruct AlterDatabaseStmt
{
NodeTag type; char *dbname; /* name of database to alter */
List *options; /* List of DefElem nodes */
} AlterDatabaseStmt;
typedefstruct AlterDatabaseSetStmt
{
NodeTag type; char *dbname; /* database name */
VariableSetStmt *setstmt; /* SET or RESET subcommand */
} AlterDatabaseSetStmt;
/* ---------------------- *DropdbStatement *----------------------
*/ typedefstruct DropdbStmt
{
NodeTag type; char *dbname; /* database to drop */ bool missing_ok; /* skip error if db is missing? */
List *options; /* currently only FORCE is supported */
} DropdbStmt;
/* ---------------------- *ClusterStatement(supportpbrown'sclusterindeximplementation) *----------------------
*/ typedefstruct ClusterStmt
{
NodeTag type;
RangeVar *relation; /* relation being indexed, or NULL if all */ char *indexname; /* original index defined */
List *params; /* list of DefElem nodes */
} ClusterStmt;
/* ---------------------- *VacuumandAnalyzeStatements * *Eventhoughthesearenominallytwostatements,it'sconvenienttouse *justonenodetypeforboth. *----------------------
*/ typedefstruct VacuumStmt
{
NodeTag type;
List *options; /* list of DefElem nodes */
List *rels; /* list of VacuumRelation, or NIL for all */ bool is_vacuumcmd; /* true for VACUUM, false for ANALYZE */
} VacuumStmt;
/* *InfoaboutasingletargettableofVACUUM/ANALYZE. * *IftheOIDfieldisset,italwaysidentifiesthetabletoprocess. *ThentherelationfieldcanbeNULL;ifitisn't,it'susedonlytoreport *failuretoopen/locktherelation.
*/ typedefstruct VacuumRelation
{
NodeTag type;
RangeVar *relation; /* table name to process, or NULL */
Oid oid; /* table's OID; InvalidOid if not looked up */
List *va_cols; /* list of column names, or NIL for all */
} VacuumRelation;
/* ---------------------- *ExplainStatement * *The"query"fieldisinitiallyarawparsetree,andisconvertedtoa *Querynodeduringparseanalysis.Notethatrewritingandplanning *ofthequeryarealwayspostponeduntilexecution. *----------------------
*/ typedefstruct ExplainStmt
{
NodeTag type;
Node *query; /* the query (see comments above) */
List *options; /* list of DefElem nodes */
} ExplainStmt;
/* ---------------------- *CREATETABLEASStatement(a/k/aSELECTINTO) * *AquerywrittenasCREATETABLEASwillproducethisnodetypenatively. *AquerywrittenasSELECT...INTOwillbetransformedtothisformduring *parseanalysis. *AquerywrittenasCREATEMATERIALIZEDviewwillproducethisnodetype, *duringparseanalysis,sinceitneedsallthesamedata. * *The"query"fieldishandledsimilarlytoEXPLAIN,thoughnotethatit *canbeaSELECToranEXECUTE,butnototherDMLstatements. *----------------------
*/ typedefstruct CreateTableAsStmt
{
NodeTag type;
Node *query; /* the query (see comments above) */
IntoClause *into; /* destination table */
ObjectType objtype; /* OBJECT_TABLE or OBJECT_MATVIEW */ bool is_select_into; /* it was written as SELECT INTO */ bool if_not_exists; /* just do nothing if it already exists? */
} CreateTableAsStmt;
/* ---------------------- *REFRESHMATERIALIZEDVIEWStatement *----------------------
*/ typedefstruct RefreshMatViewStmt
{
NodeTag type; bool concurrent; /* allow concurrent access? */ bool skipData; /* true for WITH NO DATA */
RangeVar *relation; /* relation to insert into */
} RefreshMatViewStmt;
typedefstruct ReindexStmt
{
NodeTag type;
ReindexObjectType kind; /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE,
* etc. */
RangeVar *relation; /* Table or index to reindex */ constchar *name; /* name of database to reindex */
List *params; /* list of DefElem nodes */
} ReindexStmt;
/* ---------------------- *CREATECONVERSIONStatement *----------------------
*/ typedefstruct CreateConversionStmt
{
NodeTag type;
List *conversion_name; /* Name of the conversion */ char *for_encoding_name; /* source encoding name */ char *to_encoding_name; /* destination encoding name */
List *func_name; /* qualified conversion function name */ bool def; /* is this a default conversion? */
} CreateConversionStmt;
typedefstruct ExecuteStmt
{
NodeTag type; char *name; /* The name of the plan to execute */
List *params; /* Values to assign to parameters */
} ExecuteStmt;
/* ---------------------- *DEALLOCATEStatement *----------------------
*/ typedefstruct DeallocateStmt
{
NodeTag type; /* The name of the plan to remove, NULL if DEALLOCATE ALL */ char *name pg_node_attr(query_jumble_ignore);
/* *TrueifDEALLOCATEALL.Thisisredundantwith"name==NULL",butwe *makeitaseparatefieldsothatexactlythiscondition(andnotthe *precisename)willbeaccountedforinqueryjumbling.
*/ bool isall; /* token location, or -1 if unknown */
ParseLoc location pg_node_attr(query_jumble_location);
} DeallocateStmt;
/* *TSDictionarystmts:DefineStmt,RenameStmtandDropStmtaredefault
*/ typedefstruct AlterTSDictionaryStmt
{
NodeTag type;
List *dictname; /* qualified name (list of String) */
List *options; /* List of DefElem nodes */
} AlterTSDictionaryStmt;
typedefstruct AlterTSConfigurationStmt
{
NodeTag type;
AlterTSConfigType kind; /* ALTER_TSCONFIG_ADD_MAPPING, etc */
List *cfgname; /* qualified name (list of String) */
/* *dictswillbenon-NILifADD/ALTERMAPPINGwasspecified.Ifdictsis *NIL,buttokentypeisn't,DROPMAPPINGwasspecified.
*/
List *tokentype; /* list of String */
List *dicts; /* list of list of String */ bool override; /* if true - remove old variant */ bool replace; /* if true - replace dictionary by another */ bool missing_ok; /* for DROP - skip error if missing? */
} AlterTSConfigurationStmt;
typedefstruct PublicationTable
{
NodeTag type;
RangeVar *relation; /* relation to be published */
Node *whereClause; /* qualifications */
List *columns; /* List of columns in a publication table */
} PublicationTable;
/* *Publicationobjecttype
*/ typedefenum PublicationObjSpecType
{
PUBLICATIONOBJ_TABLE, /* A table */
PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
* search_path */
PUBLICATIONOBJ_CONTINUATION, /* Continuation of previous type */
} PublicationObjSpecType;
typedefstruct PublicationObjSpec
{
NodeTag type;
PublicationObjSpecType pubobjtype; /* type of this publication object */ char *name;
PublicationTable *pubtable;
ParseLoc location; /* token location, or -1 if unknown */
} PublicationObjSpec;
typedefstruct CreatePublicationStmt
{
NodeTag type; char *pubname; /* Name of the publication */
List *options; /* List of DefElem nodes */
List *pubobjects; /* Optional list of publication objects */ bool for_all_tables; /* Special publication for all tables in db */
} CreatePublicationStmt;
typedefenum AlterPublicationAction
{
AP_AddObjects, /* add objects to publication */
AP_DropObjects, /* remove objects from publication */
AP_SetObjects, /* set list of objects */
} AlterPublicationAction;
typedefstruct AlterPublicationStmt
{
NodeTag type; char *pubname; /* Name of the publication */
/* parameters used for ALTER PUBLICATION ... WITH */
List *options; /* List of DefElem nodes */
/* *ParametersusedforALTERPUBLICATION...ADD/DROP/SETpublication *objects.
*/
List *pubobjects; /* Optional list of publication objects */ bool for_all_tables; /* Special publication for all tables in db */
AlterPublicationAction action; /* What action to perform with the given
* objects */
} AlterPublicationStmt;
typedefstruct CreateSubscriptionStmt
{
NodeTag type; char *subname; /* Name of the subscription */ char *conninfo; /* Connection string to publisher */
List *publication; /* One or more publication to subscribe to */
List *options; /* List of DefElem nodes */
} CreateSubscriptionStmt;
typedefstruct AlterSubscriptionStmt
{
NodeTag type;
AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */ char *subname; /* Name of the subscription */ char *conninfo; /* Connection string to publisher */
List *publication; /* One or more publication to subscribe to */
List *options; /* List of DefElem nodes */
} AlterSubscriptionStmt;
typedefstruct DropSubscriptionStmt
{
NodeTag type; char *subname; /* Name of the subscription */ bool missing_ok; /* Skip error if missing? */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
} DropSubscriptionStmt;
#endif/* PARSENODES_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.219 Sekunden
(vorverarbeitet am 2026-08-08)
¤
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.