Skip to main content

Module nodes

Module nodes 

Source
Expand description

The raw parse tree: the node types of PostgreSQL and their text.

The types are generated from the vendored headers into generated/nodes.rs, with the names and the fields that PostgreSQL gives them, so an action of gram.y ports to Rust line by line. This module has what the generator does not write: the names of the field types, the helpers of the writers, the writers of the three node types that outfuncs.c writes by hand, and the Equal of the pointers and the lists.

The text of a node is the text of nodeToStringWithLocations. PostgreSQL logs that text for the raw parse tree of each statement when debug_print_raw_parse is on, so a test can compare the tree of this parser with the tree of PostgreSQL for the same statement.

Lifted from crates/rudb-pgparse/src/nodes.rs of tamnd/rudb at f5f7065a (spec/04 section 4.9).

Structs§

ATAlterConstraint
The node ATAlterConstraint.
A_ArrayExpr
The node A_ArrayExpr.
A_Const
The node A_Const.
A_Expr
The node A_Expr.
A_Expr_Kind
The C enum A_Expr_Kind.
A_Indices
The node A_Indices.
A_Indirection
The node A_Indirection.
A_Star
The node A_Star.
AccessPriv
The node AccessPriv.
Alias
The node Alias.
AlterCollationStmt
The node AlterCollationStmt.
AlterDatabaseRefreshCollStmt
The node AlterDatabaseRefreshCollStmt.
AlterDatabaseSetStmt
The node AlterDatabaseSetStmt.
AlterDatabaseStmt
The node AlterDatabaseStmt.
AlterDefaultPrivilegesStmt
The node AlterDefaultPrivilegesStmt.
AlterDomainStmt
The node AlterDomainStmt.
AlterDomainType
The C enum AlterDomainType.
AlterEnumStmt
The node AlterEnumStmt.
AlterEventTrigStmt
The node AlterEventTrigStmt.
AlterExtensionContentsStmt
The node AlterExtensionContentsStmt.
AlterExtensionStmt
The node AlterExtensionStmt.
AlterFdwStmt
The node AlterFdwStmt.
AlterForeignServerStmt
The node AlterForeignServerStmt.
AlterFunctionStmt
The node AlterFunctionStmt.
AlterObjectDependsStmt
The node AlterObjectDependsStmt.
AlterObjectSchemaStmt
The node AlterObjectSchemaStmt.
AlterOpFamilyStmt
The node AlterOpFamilyStmt.
AlterOperatorStmt
The node AlterOperatorStmt.
AlterOwnerStmt
The node AlterOwnerStmt.
AlterPolicyStmt
The node AlterPolicyStmt.
AlterPublicationAction
The C enum AlterPublicationAction.
AlterPublicationStmt
The node AlterPublicationStmt.
AlterRoleSetStmt
The node AlterRoleSetStmt.
AlterRoleStmt
The node AlterRoleStmt.
AlterSeqStmt
The node AlterSeqStmt.
AlterStatsStmt
The node AlterStatsStmt.
AlterSubscriptionStmt
The node AlterSubscriptionStmt.
AlterSubscriptionType
The C enum AlterSubscriptionType.
AlterSystemStmt
The node AlterSystemStmt.
AlterTSConfigType
The C enum AlterTSConfigType.
AlterTSConfigurationStmt
The node AlterTSConfigurationStmt.
AlterTSDictionaryStmt
The node AlterTSDictionaryStmt.
AlterTableCmd
The node AlterTableCmd.
AlterTableMoveAllStmt
The node AlterTableMoveAllStmt.
AlterTableSpaceOptionsStmt
The node AlterTableSpaceOptionsStmt.
AlterTableStmt
The node AlterTableStmt.
AlterTableType
The C enum AlterTableType.
AlterTypeStmt
The node AlterTypeStmt.
AlterUserMappingStmt
The node AlterUserMappingStmt.
BoolExpr
The node BoolExpr.
BoolExprType
The C enum BoolExprType.
BoolTestType
The C enum BoolTestType.
BooleanTest
The node BooleanTest.
CTECycleClause
The node CTECycleClause.
CTEMaterialize
The C enum CTEMaterialize.
CTESearchClause
The node CTESearchClause.
CallStmt
The node CallStmt.
CaseExpr
The node CaseExpr.
CaseWhen
The node CaseWhen.
CheckPointStmt
The node CheckPointStmt.
ClosePortalStmt
The node ClosePortalStmt.
CmdType
The C enum CmdType.
CoalesceExpr
The node CoalesceExpr.
CoercionContext
The C enum CoercionContext.
CoercionForm
The C enum CoercionForm.
CollateClause
The node CollateClause.
ColumnDef
The node ColumnDef.
ColumnRef
The node ColumnRef.
CommentStmt
The node CommentStmt.
CommonTableExpr
The node CommonTableExpr.
CompositeTypeStmt
The node CompositeTypeStmt.
ConstrType
The C enum ConstrType.
Constraint
The node Constraint.
ConstraintsSetStmt
The node ConstraintsSetStmt.
CopyStmt
The node CopyStmt.
CreateAmStmt
The node CreateAmStmt.
CreateCastStmt
The node CreateCastStmt.
CreateConversionStmt
The node CreateConversionStmt.
CreateDomainStmt
The node CreateDomainStmt.
CreateEnumStmt
The node CreateEnumStmt.
CreateEventTrigStmt
The node CreateEventTrigStmt.
CreateExtensionStmt
The node CreateExtensionStmt.
CreateFdwStmt
The node CreateFdwStmt.
CreateForeignServerStmt
The node CreateForeignServerStmt.
CreateForeignTableStmt
The node CreateForeignTableStmt.
CreateFunctionStmt
The node CreateFunctionStmt.
CreateOpClassItem
The node CreateOpClassItem.
CreateOpClassStmt
The node CreateOpClassStmt.
CreateOpFamilyStmt
The node CreateOpFamilyStmt.
CreatePLangStmt
The node CreatePLangStmt.
CreatePolicyStmt
The node CreatePolicyStmt.
CreatePublicationStmt
The node CreatePublicationStmt.
CreateRangeStmt
The node CreateRangeStmt.
CreateRoleStmt
The node CreateRoleStmt.
CreateSchemaStmt
The node CreateSchemaStmt.
CreateSeqStmt
The node CreateSeqStmt.
CreateStatsStmt
The node CreateStatsStmt.
CreateStmt
The node CreateStmt.
CreateSubscriptionStmt
The node CreateSubscriptionStmt.
CreateTableAsStmt
The node CreateTableAsStmt.
CreateTableSpaceStmt
The node CreateTableSpaceStmt.
CreateTransformStmt
The node CreateTransformStmt.
CreateTrigStmt
The node CreateTrigStmt.
CreateUserMappingStmt
The node CreateUserMappingStmt.
CreatedbStmt
The node CreatedbStmt.
CurrentOfExpr
The node CurrentOfExpr.
DeallocateStmt
The node DeallocateStmt.
DeclareCursorStmt
The node DeclareCursorStmt.
DefElem
The node DefElem.
DefElemAction
The C enum DefElemAction.
DefineStmt
The node DefineStmt.
DeleteStmt
The node DeleteStmt.
DiscardMode
The C enum DiscardMode.
DiscardStmt
The node DiscardStmt.
DoStmt
The node DoStmt.
DropBehavior
The C enum DropBehavior.
DropOwnedStmt
The node DropOwnedStmt.
DropRoleStmt
The node DropRoleStmt.
DropStmt
The node DropStmt.
DropSubscriptionStmt
The node DropSubscriptionStmt.
DropTableSpaceStmt
The node DropTableSpaceStmt.
DropUserMappingStmt
The node DropUserMappingStmt.
DropdbStmt
The node DropdbStmt.
ExecuteStmt
The node ExecuteStmt.
ExplainStmt
The node ExplainStmt.
FetchDirection
The C enum FetchDirection.
FetchDirectionKeywords
The C enum FetchDirectionKeywords.
FetchStmt
The node FetchStmt.
FuncCall
The node FuncCall.
FunctionParameter
The node FunctionParameter.
FunctionParameterMode
The C enum FunctionParameterMode.
GrantRoleStmt
The node GrantRoleStmt.
GrantStmt
The node GrantStmt.
GrantTargetType
The C enum GrantTargetType.
GroupingFunc
The node GroupingFunc.
GroupingSet
The node GroupingSet.
GroupingSetKind
The C enum GroupingSetKind.
ImportForeignSchemaStmt
The node ImportForeignSchemaStmt.
ImportForeignSchemaType
The C enum ImportForeignSchemaType.
IndexElem
The node IndexElem.
IndexStmt
The node IndexStmt.
InferClause
The node InferClause.
InsertStmt
The node InsertStmt.
IntoClause
The node IntoClause.
JoinExpr
The node JoinExpr.
JoinType
The C enum JoinType.
JsonAggConstructor
The node JsonAggConstructor.
JsonArgument
The node JsonArgument.
JsonArrayAgg
The node JsonArrayAgg.
JsonArrayConstructor
The node JsonArrayConstructor.
JsonArrayQueryConstructor
The node JsonArrayQueryConstructor.
JsonBehavior
The node JsonBehavior.
JsonBehaviorType
The C enum JsonBehaviorType.
JsonEncoding
The C enum JsonEncoding.
JsonExprOp
The C enum JsonExprOp.
JsonFormat
The node JsonFormat.
JsonFormatType
The C enum JsonFormatType.
JsonFuncExpr
The node JsonFuncExpr.
JsonIsPredicate
The node JsonIsPredicate.
JsonKeyValue
The node JsonKeyValue.
JsonObjectAgg
The node JsonObjectAgg.
JsonObjectConstructor
The node JsonObjectConstructor.
JsonOutput
The node JsonOutput.
JsonParseExpr
The node JsonParseExpr.
JsonQuotes
The C enum JsonQuotes.
JsonReturning
The node JsonReturning.
JsonScalarExpr
The node JsonScalarExpr.
JsonSerializeExpr
The node JsonSerializeExpr.
JsonTable
The node JsonTable.
JsonTableColumn
The node JsonTableColumn.
JsonTableColumnType
The C enum JsonTableColumnType.
JsonTablePathSpec
The node JsonTablePathSpec.
JsonValueExpr
The node JsonValueExpr.
JsonValueType
The C enum JsonValueType.
JsonWrapper
The C enum JsonWrapper.
LimitOption
The C enum LimitOption.
ListenStmt
The node ListenStmt.
LoadStmt
The node LoadStmt.
LockClauseStrength
The C enum LockClauseStrength.
LockStmt
The node LockStmt.
LockWaitPolicy
The C enum LockWaitPolicy.
LockingClause
The node LockingClause.
MergeMatchKind
The C enum MergeMatchKind.
MergeStmt
The node MergeStmt.
MergeSupportFunc
The node MergeSupportFunc.
MergeWhenClause
The node MergeWhenClause.
MinMaxExpr
The node MinMaxExpr.
MinMaxOp
The C enum MinMaxOp.
MultiAssignRef
The node MultiAssignRef.
NamedArgExpr
The node NamedArgExpr.
NotifyStmt
The node NotifyStmt.
NullTest
The node NullTest.
NullTestType
The C enum NullTestType.
ObjectType
The C enum ObjectType.
ObjectWithArgs
The node ObjectWithArgs.
OnCommitAction
The C enum OnCommitAction.
OnConflictAction
The C enum OnConflictAction.
OnConflictClause
The node OnConflictClause.
OverridingKind
The C enum OverridingKind.
PLAssignStmt
The node PLAssignStmt.
ParamRef
The node ParamRef.
PartitionBoundSpec
The node PartitionBoundSpec.
PartitionCmd
The node PartitionCmd.
PartitionElem
The node PartitionElem.
PartitionSpec
The node PartitionSpec.
PartitionStrategy
The C enum PartitionStrategy.
PrepareStmt
The node PrepareStmt.
PublicationAllObjSpec
The node PublicationAllObjSpec.
PublicationAllObjType
The C enum PublicationAllObjType.
PublicationObjSpec
The node PublicationObjSpec.
PublicationObjSpecType
The C enum PublicationObjSpecType.
PublicationTable
The node PublicationTable.
RangeFunction
The node RangeFunction.
RangeSubselect
The node RangeSubselect.
RangeTableFunc
The node RangeTableFunc.
RangeTableFuncCol
The node RangeTableFuncCol.
RangeTableSample
The node RangeTableSample.
RangeVar
The node RangeVar.
RawStmt
The node RawStmt.
ReassignOwnedStmt
The node ReassignOwnedStmt.
RefreshMatViewStmt
The node RefreshMatViewStmt.
ReindexObjectType
The C enum ReindexObjectType.
ReindexStmt
The node ReindexStmt.
RenameStmt
The node RenameStmt.
RepackCommand
The C enum RepackCommand.
RepackStmt
The node RepackStmt.
ReplicaIdentityStmt
The node ReplicaIdentityStmt.
ResTarget
The node ResTarget.
ReturnStmt
The node ReturnStmt.
ReturningClause
The node ReturningClause.
ReturningOption
The node ReturningOption.
ReturningOptionKind
The C enum ReturningOptionKind.
RoleSpec
The node RoleSpec.
RoleSpecType
The C enum RoleSpecType.
RoleStmtType
The C enum RoleStmtType.
RowExpr
The node RowExpr.
RuleStmt
The node RuleStmt.
SQLValueFunction
The node SQLValueFunction.
SQLValueFunctionOp
The C enum SQLValueFunctionOp.
SecLabelStmt
The node SecLabelStmt.
SelectStmt
The node SelectStmt.
SetOperation
The C enum SetOperation.
SetQuantifier
The C enum SetQuantifier.
SetToDefault
The node SetToDefault.
SortBy
The node SortBy.
SortByDir
The C enum SortByDir.
SortByNulls
The C enum SortByNulls.
StatsElem
The node StatsElem.
SubLink
The node SubLink.
SubLinkType
The C enum SubLinkType.
TableLikeClause
The node TableLikeClause.
TableLikeOption
The C enum TableLikeOption.
TransactionStmt
The node TransactionStmt.
TransactionStmtKind
The C enum TransactionStmtKind.
TriggerTransition
The node TriggerTransition.
TruncateStmt
The node TruncateStmt.
TypeCast
The node TypeCast.
TypeName
The node TypeName.
UnlistenStmt
The node UnlistenStmt.
UpdateStmt
The node UpdateStmt.
VacuumRelation
The node VacuumRelation.
VacuumStmt
The node VacuumStmt.
VariableSetKind
The C enum VariableSetKind.
VariableSetStmt
The node VariableSetStmt.
VariableShowStmt
The node VariableShowStmt.
ViewCheckOption
The C enum ViewCheckOption.
ViewStmt
The node ViewStmt.
WaitStmt
The node WaitStmt.
WindowDef
The node WindowDef.
WithClause
The node WithClause.
XmlExpr
The node XmlExpr.
XmlExprOp
The C enum XmlExprOp.
XmlOptionType
The C enum XmlOptionType.
XmlSerialize
The node XmlSerialize.
XmlStandaloneType
The C enum XmlStandaloneType.

Enums§

Node
A node of the raw parse tree. The nodes of value.h hold their value, and the other node types are boxed.

Constants§

AMTYPE_INDEX
AMTYPE_TABLE
ATTRIBUTE_GENERATED_STORED
ATTRIBUTE_GENERATED_VIRTUAL
ATTRIBUTE_IDENTITY_ALWAYS
ATTRIBUTE_IDENTITY_BY_DEFAULT
AccessExclusiveLock
AccessShareLock
CURSOR_OPT_ASENSITIVE
CURSOR_OPT_BINARY
CURSOR_OPT_FAST_PLAN
CURSOR_OPT_HOLD
CURSOR_OPT_INSENSITIVE
CURSOR_OPT_NO_SCROLL
CURSOR_OPT_SCROLL
DAY
DEFAULT_INDEX_TYPE
ERRCODE_DUPLICATE_OBJECT
ERRCODE_FEATURE_NOT_SUPPORTED
ERRCODE_INVALID_PARAMETER_VALUE
ERRCODE_RESERVED_NAME
ERRCODE_SYNTAX_ERROR
ERRCODE_WINDOWING_ERROR
ExclusiveLock
FETCH_ALL
FKCONSTR_ACTION_CASCADE
FKCONSTR_ACTION_NOACTION
FKCONSTR_ACTION_RESTRICT
FKCONSTR_ACTION_SETDEFAULT
FKCONSTR_ACTION_SETNULL
FKCONSTR_MATCH_FULL
FKCONSTR_MATCH_PARTIAL
FKCONSTR_MATCH_SIMPLE
FRAMEOPTION_BETWEEN
FRAMEOPTION_DEFAULTS
FRAMEOPTION_END_CURRENT_ROW
FRAMEOPTION_END_OFFSET_PRECEDING
FRAMEOPTION_END_UNBOUNDED_PRECEDING
FRAMEOPTION_EXCLUDE_CURRENT_ROW
FRAMEOPTION_EXCLUDE_GROUP
FRAMEOPTION_EXCLUDE_TIES
FRAMEOPTION_GROUPS
FRAMEOPTION_NONDEFAULT
FRAMEOPTION_RANGE
FRAMEOPTION_ROWS
FRAMEOPTION_START_CURRENT_ROW
FRAMEOPTION_START_OFFSET_FOLLOWING
FRAMEOPTION_START_OFFSET_PRECEDING
FRAMEOPTION_START_UNBOUNDED_FOLLOWING
FRAMEOPTION_START_UNBOUNDED_PRECEDING
HOUR
INTERVAL_FULL_RANGE
InvalidOid
InvalidRelFileNumber
InvalidSubTransactionId
MINUTE
MONTH
NO_NULLTREATMENT
OPCLASS_ITEM_FUNCTION
OPCLASS_ITEM_OPERATOR
OPCLASS_ITEM_STORAGETYPE
PARSER_IGNORE_NULLS
PARSER_RESPECT_NULLS
PG_INT16_MAX
RELPERSISTENCE_PERMANENT
RELPERSISTENCE_TEMP
RELPERSISTENCE_UNLOGGED
REPLICA_IDENTITY_DEFAULT
REPLICA_IDENTITY_FULL
REPLICA_IDENTITY_INDEX
REPLICA_IDENTITY_NOTHING
RowExclusiveLock
RowShareLock
SECOND
ShareLock
ShareRowExclusiveLock
ShareUpdateExclusiveLock
TEXTOID
TRIGGER_DISABLED
TRIGGER_FIRES_ALWAYS
TRIGGER_FIRES_ON_ORIGIN
TRIGGER_FIRES_ON_REPLICA
TRIGGER_TYPE_AFTER
TRIGGER_TYPE_BEFORE
TRIGGER_TYPE_DELETE
TRIGGER_TYPE_INSERT
TRIGGER_TYPE_INSTEAD
TRIGGER_TYPE_TRUNCATE
TRIGGER_TYPE_UPDATE
YEAR

Traits§

Equal
equal() of equalfuncs.c: two trees are equal when all their fields are equal, except the locations. The derived PartialEq compares the locations too, so it is not equal().
NodeType
A node type that is a variant of Node, with the casts of castNode and IsA.
Out
A node type that outNode writes in braces.

Functions§

list_text
The text of nodeToStringWithLocations for a list, for example the list of RawStmt nodes that the parser gives for a query.

Type Aliases§

List
A List * of nodes. NIL is the empty list. An element can be NULL, as in the list_make1(NIL) of DISTINCT, and outfuncs.c writes it as <>.
Str
The text of a char * field.