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§
- ATAlter
Constraint - The node
ATAlterConstraint. - A_
Array Expr - 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. - Access
Priv - The node
AccessPriv. - Alias
- The node
Alias. - Alter
Collation Stmt - The node
AlterCollationStmt. - Alter
Database Refresh Coll Stmt - The node
AlterDatabaseRefreshCollStmt. - Alter
Database SetStmt - The node
AlterDatabaseSetStmt. - Alter
Database Stmt - The node
AlterDatabaseStmt. - Alter
Default Privileges Stmt - The node
AlterDefaultPrivilegesStmt. - Alter
Domain Stmt - The node
AlterDomainStmt. - Alter
Domain Type - The C enum
AlterDomainType. - Alter
Enum Stmt - The node
AlterEnumStmt. - Alter
Event Trig Stmt - The node
AlterEventTrigStmt. - Alter
Extension Contents Stmt - The node
AlterExtensionContentsStmt. - Alter
Extension Stmt - The node
AlterExtensionStmt. - Alter
FdwStmt - The node
AlterFdwStmt. - Alter
Foreign Server Stmt - The node
AlterForeignServerStmt. - Alter
Function Stmt - The node
AlterFunctionStmt. - Alter
Object Depends Stmt - The node
AlterObjectDependsStmt. - Alter
Object Schema Stmt - The node
AlterObjectSchemaStmt. - Alter
OpFamily Stmt - The node
AlterOpFamilyStmt. - Alter
Operator Stmt - The node
AlterOperatorStmt. - Alter
Owner Stmt - The node
AlterOwnerStmt. - Alter
Policy Stmt - The node
AlterPolicyStmt. - Alter
Publication Action - The C enum
AlterPublicationAction. - Alter
Publication Stmt - The node
AlterPublicationStmt. - Alter
Role SetStmt - The node
AlterRoleSetStmt. - Alter
Role Stmt - The node
AlterRoleStmt. - Alter
SeqStmt - The node
AlterSeqStmt. - Alter
Stats Stmt - The node
AlterStatsStmt. - Alter
Subscription Stmt - The node
AlterSubscriptionStmt. - Alter
Subscription Type - The C enum
AlterSubscriptionType. - Alter
System Stmt - The node
AlterSystemStmt. - AlterTS
Config Type - The C enum
AlterTSConfigType. - AlterTS
Configuration Stmt - The node
AlterTSConfigurationStmt. - AlterTS
Dictionary Stmt - The node
AlterTSDictionaryStmt. - Alter
Table Cmd - The node
AlterTableCmd. - Alter
Table Move AllStmt - The node
AlterTableMoveAllStmt. - Alter
Table Space Options Stmt - The node
AlterTableSpaceOptionsStmt. - Alter
Table Stmt - The node
AlterTableStmt. - Alter
Table Type - The C enum
AlterTableType. - Alter
Type Stmt - The node
AlterTypeStmt. - Alter
User Mapping Stmt - The node
AlterUserMappingStmt. - Bool
Expr - The node
BoolExpr. - Bool
Expr Type - The C enum
BoolExprType. - Bool
Test Type - The C enum
BoolTestType. - Boolean
Test - The node
BooleanTest. - CTECycle
Clause - The node
CTECycleClause. - CTEMaterialize
- The C enum
CTEMaterialize. - CTESearch
Clause - The node
CTESearchClause. - Call
Stmt - The node
CallStmt. - Case
Expr - The node
CaseExpr. - Case
When - The node
CaseWhen. - Check
Point Stmt - The node
CheckPointStmt. - Close
Portal Stmt - The node
ClosePortalStmt. - CmdType
- The C enum
CmdType. - Coalesce
Expr - The node
CoalesceExpr. - Coercion
Context - The C enum
CoercionContext. - Coercion
Form - The C enum
CoercionForm. - Collate
Clause - The node
CollateClause. - Column
Def - The node
ColumnDef. - Column
Ref - The node
ColumnRef. - Comment
Stmt - The node
CommentStmt. - Common
Table Expr - The node
CommonTableExpr. - Composite
Type Stmt - The node
CompositeTypeStmt. - Constr
Type - The C enum
ConstrType. - Constraint
- The node
Constraint. - Constraints
SetStmt - The node
ConstraintsSetStmt. - Copy
Stmt - The node
CopyStmt. - Create
AmStmt - The node
CreateAmStmt. - Create
Cast Stmt - The node
CreateCastStmt. - Create
Conversion Stmt - The node
CreateConversionStmt. - Create
Domain Stmt - The node
CreateDomainStmt. - Create
Enum Stmt - The node
CreateEnumStmt. - Create
Event Trig Stmt - The node
CreateEventTrigStmt. - Create
Extension Stmt - The node
CreateExtensionStmt. - Create
FdwStmt - The node
CreateFdwStmt. - Create
Foreign Server Stmt - The node
CreateForeignServerStmt. - Create
Foreign Table Stmt - The node
CreateForeignTableStmt. - Create
Function Stmt - The node
CreateFunctionStmt. - Create
OpClass Item - The node
CreateOpClassItem. - Create
OpClass Stmt - The node
CreateOpClassStmt. - Create
OpFamily Stmt - The node
CreateOpFamilyStmt. - CreateP
Lang Stmt - The node
CreatePLangStmt. - Create
Policy Stmt - The node
CreatePolicyStmt. - Create
Publication Stmt - The node
CreatePublicationStmt. - Create
Range Stmt - The node
CreateRangeStmt. - Create
Role Stmt - The node
CreateRoleStmt. - Create
Schema Stmt - The node
CreateSchemaStmt. - Create
SeqStmt - The node
CreateSeqStmt. - Create
Stats Stmt - The node
CreateStatsStmt. - Create
Stmt - The node
CreateStmt. - Create
Subscription Stmt - The node
CreateSubscriptionStmt. - Create
Table AsStmt - The node
CreateTableAsStmt. - Create
Table Space Stmt - The node
CreateTableSpaceStmt. - Create
Transform Stmt - The node
CreateTransformStmt. - Create
Trig Stmt - The node
CreateTrigStmt. - Create
User Mapping Stmt - The node
CreateUserMappingStmt. - Createdb
Stmt - The node
CreatedbStmt. - Current
OfExpr - The node
CurrentOfExpr. - Deallocate
Stmt - The node
DeallocateStmt. - Declare
Cursor Stmt - The node
DeclareCursorStmt. - DefElem
- The node
DefElem. - DefElem
Action - The C enum
DefElemAction. - Define
Stmt - The node
DefineStmt. - Delete
Stmt - The node
DeleteStmt. - Discard
Mode - The C enum
DiscardMode. - Discard
Stmt - The node
DiscardStmt. - DoStmt
- The node
DoStmt. - Drop
Behavior - The C enum
DropBehavior. - Drop
Owned Stmt - The node
DropOwnedStmt. - Drop
Role Stmt - The node
DropRoleStmt. - Drop
Stmt - The node
DropStmt. - Drop
Subscription Stmt - The node
DropSubscriptionStmt. - Drop
Table Space Stmt - The node
DropTableSpaceStmt. - Drop
User Mapping Stmt - The node
DropUserMappingStmt. - Dropdb
Stmt - The node
DropdbStmt. - Execute
Stmt - The node
ExecuteStmt. - Explain
Stmt - The node
ExplainStmt. - Fetch
Direction - The C enum
FetchDirection. - Fetch
Direction Keywords - The C enum
FetchDirectionKeywords. - Fetch
Stmt - The node
FetchStmt. - Func
Call - The node
FuncCall. - Function
Parameter - The node
FunctionParameter. - Function
Parameter Mode - The C enum
FunctionParameterMode. - Grant
Role Stmt - The node
GrantRoleStmt. - Grant
Stmt - The node
GrantStmt. - Grant
Target Type - The C enum
GrantTargetType. - Grouping
Func - The node
GroupingFunc. - Grouping
Set - The node
GroupingSet. - Grouping
SetKind - The C enum
GroupingSetKind. - Import
Foreign Schema Stmt - The node
ImportForeignSchemaStmt. - Import
Foreign Schema Type - The C enum
ImportForeignSchemaType. - Index
Elem - The node
IndexElem. - Index
Stmt - The node
IndexStmt. - Infer
Clause - The node
InferClause. - Insert
Stmt - The node
InsertStmt. - Into
Clause - The node
IntoClause. - Join
Expr - The node
JoinExpr. - Join
Type - The C enum
JoinType. - Json
AggConstructor - The node
JsonAggConstructor. - Json
Argument - The node
JsonArgument. - Json
Array Agg - The node
JsonArrayAgg. - Json
Array Constructor - The node
JsonArrayConstructor. - Json
Array Query Constructor - The node
JsonArrayQueryConstructor. - Json
Behavior - The node
JsonBehavior. - Json
Behavior Type - The C enum
JsonBehaviorType. - Json
Encoding - The C enum
JsonEncoding. - Json
Expr Op - The C enum
JsonExprOp. - Json
Format - The node
JsonFormat. - Json
Format Type - The C enum
JsonFormatType. - Json
Func Expr - The node
JsonFuncExpr. - Json
IsPredicate - The node
JsonIsPredicate. - Json
KeyValue - The node
JsonKeyValue. - Json
Object Agg - The node
JsonObjectAgg. - Json
Object Constructor - The node
JsonObjectConstructor. - Json
Output - The node
JsonOutput. - Json
Parse Expr - The node
JsonParseExpr. - Json
Quotes - The C enum
JsonQuotes. - Json
Returning - The node
JsonReturning. - Json
Scalar Expr - The node
JsonScalarExpr. - Json
Serialize Expr - The node
JsonSerializeExpr. - Json
Table - The node
JsonTable. - Json
Table Column - The node
JsonTableColumn. - Json
Table Column Type - The C enum
JsonTableColumnType. - Json
Table Path Spec - The node
JsonTablePathSpec. - Json
Value Expr - The node
JsonValueExpr. - Json
Value Type - The C enum
JsonValueType. - Json
Wrapper - The C enum
JsonWrapper. - Limit
Option - The C enum
LimitOption. - Listen
Stmt - The node
ListenStmt. - Load
Stmt - The node
LoadStmt. - Lock
Clause Strength - The C enum
LockClauseStrength. - Lock
Stmt - The node
LockStmt. - Lock
Wait Policy - The C enum
LockWaitPolicy. - Locking
Clause - The node
LockingClause. - Merge
Match Kind - The C enum
MergeMatchKind. - Merge
Stmt - The node
MergeStmt. - Merge
Support Func - The node
MergeSupportFunc. - Merge
When Clause - The node
MergeWhenClause. - MinMax
Expr - The node
MinMaxExpr. - MinMax
Op - The C enum
MinMaxOp. - Multi
Assign Ref - The node
MultiAssignRef. - Named
ArgExpr - The node
NamedArgExpr. - Notify
Stmt - The node
NotifyStmt. - Null
Test - The node
NullTest. - Null
Test Type - The C enum
NullTestType. - Object
Type - The C enum
ObjectType. - Object
With Args - The node
ObjectWithArgs. - OnCommit
Action - The C enum
OnCommitAction. - OnConflict
Action - The C enum
OnConflictAction. - OnConflict
Clause - The node
OnConflictClause. - Overriding
Kind - The C enum
OverridingKind. - PLAssign
Stmt - The node
PLAssignStmt. - Param
Ref - The node
ParamRef. - Partition
Bound Spec - The node
PartitionBoundSpec. - Partition
Cmd - The node
PartitionCmd. - Partition
Elem - The node
PartitionElem. - Partition
Spec - The node
PartitionSpec. - Partition
Strategy - The C enum
PartitionStrategy. - Prepare
Stmt - The node
PrepareStmt. - Publication
AllObj Spec - The node
PublicationAllObjSpec. - Publication
AllObj Type - The C enum
PublicationAllObjType. - Publication
ObjSpec - The node
PublicationObjSpec. - Publication
ObjSpec Type - The C enum
PublicationObjSpecType. - Publication
Table - The node
PublicationTable. - Range
Function - The node
RangeFunction. - Range
Subselect - The node
RangeSubselect. - Range
Table Func - The node
RangeTableFunc. - Range
Table Func Col - The node
RangeTableFuncCol. - Range
Table Sample - The node
RangeTableSample. - Range
Var - The node
RangeVar. - RawStmt
- The node
RawStmt. - Reassign
Owned Stmt - The node
ReassignOwnedStmt. - Refresh
MatView Stmt - The node
RefreshMatViewStmt. - Reindex
Object Type - The C enum
ReindexObjectType. - Reindex
Stmt - The node
ReindexStmt. - Rename
Stmt - The node
RenameStmt. - Repack
Command - The C enum
RepackCommand. - Repack
Stmt - The node
RepackStmt. - Replica
Identity Stmt - The node
ReplicaIdentityStmt. - ResTarget
- The node
ResTarget. - Return
Stmt - The node
ReturnStmt. - Returning
Clause - The node
ReturningClause. - Returning
Option - The node
ReturningOption. - Returning
Option Kind - The C enum
ReturningOptionKind. - Role
Spec - The node
RoleSpec. - Role
Spec Type - The C enum
RoleSpecType. - Role
Stmt Type - The C enum
RoleStmtType. - RowExpr
- The node
RowExpr. - Rule
Stmt - The node
RuleStmt. - SQLValue
Function - The node
SQLValueFunction. - SQLValue
Function Op - The C enum
SQLValueFunctionOp. - SecLabel
Stmt - The node
SecLabelStmt. - Select
Stmt - The node
SelectStmt. - SetOperation
- The C enum
SetOperation. - SetQuantifier
- The C enum
SetQuantifier. - SetTo
Default - The node
SetToDefault. - SortBy
- The node
SortBy. - Sort
ByDir - The C enum
SortByDir. - Sort
ByNulls - The C enum
SortByNulls. - Stats
Elem - The node
StatsElem. - SubLink
- The node
SubLink. - SubLink
Type - The C enum
SubLinkType. - Table
Like Clause - The node
TableLikeClause. - Table
Like Option - The C enum
TableLikeOption. - Transaction
Stmt - The node
TransactionStmt. - Transaction
Stmt Kind - The C enum
TransactionStmtKind. - Trigger
Transition - The node
TriggerTransition. - Truncate
Stmt - The node
TruncateStmt. - Type
Cast - The node
TypeCast. - Type
Name - The node
TypeName. - Unlisten
Stmt - The node
UnlistenStmt. - Update
Stmt - The node
UpdateStmt. - Vacuum
Relation - The node
VacuumRelation. - Vacuum
Stmt - The node
VacuumStmt. - Variable
SetKind - The C enum
VariableSetKind. - Variable
SetStmt - The node
VariableSetStmt. - Variable
Show Stmt - The node
VariableShowStmt. - View
Check Option - The C enum
ViewCheckOption. - View
Stmt - The node
ViewStmt. - Wait
Stmt - The node
WaitStmt. - Window
Def - The node
WindowDef. - With
Clause - The node
WithClause. - XmlExpr
- The node
XmlExpr. - XmlExpr
Op - The C enum
XmlExprOp. - XmlOption
Type - The C enum
XmlOptionType. - XmlSerialize
- The node
XmlSerialize. - XmlStandalone
Type - The C enum
XmlStandaloneType.
Enums§
- Node
- A node of the raw parse tree. The nodes of
value.hhold 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 - Access
Exclusive Lock - Access
Share Lock - 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 - Exclusive
Lock - 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 - Invalid
Oid - Invalid
RelFile Number - Invalid
SubTransaction Id - 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 - RowExclusive
Lock - RowShare
Lock - SECOND
- Share
Lock - Share
RowExclusive Lock - Share
Update Exclusive Lock - 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()ofequalfuncs.c: two trees are equal when all their fields are equal, except the locations. The derivedPartialEqcompares the locations too, so it is notequal().- Node
Type - A node type that is a variant of
Node, with the casts ofcastNodeandIsA. - Out
- A node type that
outNodewrites in braces.
Functions§
- list_
text - The text of
nodeToStringWithLocationsfor a list, for example the list ofRawStmtnodes that the parser gives for a query.