Expand description
Internal SQL AST. Lifts the relevant subset of the libpg_query
protobuf tree into a Rust enum the compiler walks. Statements not
yet supported parse cleanly but compile to
crate::SQLError::Unsupported.
Structs§
- Alter
Foreign Table Stmt - Alter
Role Stmt - Alter
Routine Owner Stmt - Alter
Routine Stmt ALTER FUNCTION | PROCEDURE | ROUTINE name[(input_types)] ...with an optional exact declared input identity.- Alter
Sequence - Alter
Table Stmt - Alter
View Stmt - Assignment
Target - Target syntax is separate from the value expression. Every bound belongs to the original input row, even when repeated targets compose writes to one column.
- Auto
Increment - Durable sequence provenance for a
SERIALor identity column. - Auto
Increment Owner - Durable owner of an implicit sequence. Inherited
SERIALdefaults and declarative partitions copy this owner unchanged, so truncating a child cannot reset a sequence owned by its parent. - CTE
- Column
Def - Constraint
Catalog Identity - Create
Domain - Create
Foreign Server - Create
Foreign Table - Create
Function CREATE [OR REPLACE] FUNCTION | PROCEDURE.- Create
Index - Create
Role Stmt - Create
Rule - Create
Sequence - Create
Table - Create
Trigger - CteCycle
Clause PostgreSQLrecursive-CTE cycle detection metadata.- CteSearch
Clause PostgreSQLrecursive-CTE traversal-order metadata.- Declare
Cursor Stmt - Deferred
Create Foreign Table - A syntactically valid
CREATE FOREIGN TABLE IF NOT EXISTSwhose definition must be analyzed only when its target name is free. - Deferred
Create Table - A syntactically valid
CREATE TABLE IF NOT EXISTSwhose definition must be analyzed only after execution has established that the target relation does not already exist. - DeferredSQL
Error - An error a statement found while compiling, which it raises later, where
PostgreSQLraises it. - Delete
Stmt - Detached
Partition Constraint - Domain
Check - Domain
NotNull - Drop
Function Item - One
DROP FUNCTION/DROP PROCEDUREtarget. - Drop
Function Stmt DROP FUNCTION [IF EXISTS] name[(argtypes)] [, ...]and theDROP PROCEDUREequivalent.- Drop
Role Stmt - Drop
Rule - Drop
Stmt - Drop
Trigger - Fetch
Cursor Stmt - Foreign
Key - Table-level foreign key. Compilation preserves an omitted referenced column list as empty; validation fills it from the primary key before publication.
- Foreign
KeyRef REFERENCES table[(column)]reference target.- Function
Binding - Function
Param - One declared parameter of a user-defined function or procedure.
- Generated
Column - Grant
Database Stmt GRANTorREVOKEofCONNECT,CREATE, andTEMPORARYon databases.- Grant
Role Stmt GRANT role TO memberorREVOKE role FROM member.- Grant
Routine Item - Grant
Routine Stmt - Grant
Schema Stmt GRANTorREVOKEofUSAGEandCREATEon schemas.- Grant
Sequence Stmt GRANTorREVOKEofUSAGE,SELECT, andUPDATEon sequences.- Grant
Table Stmt GRANTorREVOKEof privileges on ordinary tables. An empty privilege list recordsALL PRIVILEGESso explicit sequence targets can expand against their own privilege set.- Identity
Sequence Declaration - The sequence options an identity column declaration writes,
GENERATED ... AS IDENTITY (options). They create the column’s sequence, which keeps them; the column does not. - Identity
Sequence Name - The name
SEQUENCE NAMEgives an identity sequence: its schema, when written, and its name. - Index
Column Order - Insert
Stmt - Join
Using - Lock
Table Stmt - Lock
Table Target - Locking
Clause - One
PostgreSQLrow-locking clause, including optionalOFtargets and theNOWAIT/SKIP LOCKEDwait policy. - Merge
Stmt - Merge
Target Column Binding - OnConflict
- Operator
Join Relations - The two independently bound catalog relations consumed by an operator-join table function.
- Operator
Resolution Error - OrderBy
- Partition
Identity Override - Partition
Spec - Projection
- Rename
Index Stmt - Rename
Role Stmt - Rename
Routine Stmt ALTER FUNCTION | PROCEDURE | ROUTINE name[(input_types)] RENAME TO new_name.- Returning
Aliases - Role
Membership Options PostgreSQL18 options stored on one role-membership grant.- Routine
AclEntry - One explicit
EXECUTEACL entry.NoneonCreateFunction::execute_aclretainsPostgreSQL’s default public execution privilege. - Routine
Column Type Reference - Structured relation-column identity carried by a routine
%TYPEdeclaration until catalog binding resolves it to a concrete SQL type. - Routine
Invocation Binding - Concrete parameter and result types selected for one routine invocation.
- Routine
Security Attributes - Execution identity and planner leakproofness attached to a routine definition.
- Select
Stmt - Sequence
Declaration - The options a
CREATE SEQUENCE, or the declaration of an identity column, writes, kept as written.PostgreSQLreads their values and derives the omitted ones when it creates the sequence, in an order of its own. - SetConstraint
Name - SetOp
- Table
Check CHECK (expr)constraint with an optional name (CONSTRAINT <name> CHECK (...)).- Table
Constraint Set - Durable table-level constraints that do not fit in
ColumnDef. - Table
Function - One function inside a
FromClause::FunctionGroup. - Table
Hierarchy - Metadata shared by ordinary inheritance and declarative partitioning.
- Table
KeyConstraint - A table key whose columns are compared as one tuple.
- Table
Privilege Spec - One table privilege and its optional column list. Unsupported names and column forms survive compilation so execution can preserve
PostgreSQLobject- and role-resolution precedence. - Transaction
Characteristics - Trigger
Transition Relation - Truncate
Target - Update
Stmt - Vacuum
Option - One parser-normalized
VACUUMoption. Execution validates options before rejecting transaction blocks, then resolves relation targets, matchingPostgreSQL’s diagnostic order. - Vacuum
Stmt - Vacuum
Target - One relation (and optional ANALYZE column list) named by
VACUUM. - Window
Frame - Window
Reference - Window
Spec
Enums§
- AclRole
Specification - Alter
Foreign Table Action - Alter
Routine Kind - Routine namespace selected by
ALTER FUNCTION,ALTER PROCEDURE, orALTER ROUTINE. - Alter
Table Action - Alter
View Action - Alter
View Kind - Assignment
Step - Auto
Increment Kind PostgreSQLsyntax that supplies an omitted column value from an implicit sequence.SERIALis a sequence-backed default, while identity columns retain a separate generation attribute and do not have a column default.- Binary
Op - Column
Type - CteBody
- A CTE owns a query or a data-modifying statement. The serialized
queryarm retains the original SELECT-only catalog representation. - CteMaterialization
- The planning fence requested for one common-table expression.
- Cursor
Direction - Database
Privilege - One requested database privilege. Unsupported names survive compilation so execution can preserve
PostgreSQLtarget- and role-resolution precedence. - Database
Revoke Behavior - Dependency behavior for database privilege revocation.
- Discard
Target DISCARDtarget. MirrorsPostgreSQL’sDiscardMode.- Drop
Kind - Event
Enable Mode - Expr
- Scalar expression nodes the compiler handles.
- Foreign
KeyAction - Foreign
KeyMatch - Frame
Bound - Frame
Mode - From
Clause - Function
Body - Body of a user-defined routine.
- Function
Dispatch - Structural identity for parser-owned expressions and overload-specific built-in implementations. These variants occupy no SQL function-name namespace.
- Function
Parallel PARALLEL UNSAFE,PARALLEL RESTRICTED, orPARALLEL SAFEroutine metadata.- Function
Param Mode - Parameter mode of a
CREATE FUNCTION/CREATE PROCEDUREargument. MirrorsPostgreSQL’sFunctionParameterMode. - Function
Resolution Error - Static function-call failure discovered while binding declared argument types.
- Function
Returns - Declared result shape of a user-defined function.
- Function
Volatility IMMUTABLE/STABLE/VOLATILEmarker.- Generated
Column Kind - Grant
Sequence Target - Relation targets carried by
GRANTorREVOKEfor sequences. - Grant
Table Target - Relation targets carried by
GRANTorREVOKEwith theTABLEobject class. - Index
Key - Interval
Fields - The stored-field restriction in a
PostgreSQLinterval declaration. - Join
Kind - Lock
Strength PostgreSQLrow-lock strength, strongest last.- Lock
Wait - Wait policy for a row-locking clause.
- Merge
When - Nulls
Order - Numeric
Operator - Numeric operator syntax, kept separate from ordinary calls such as
modorabs. - OnCommit
Action ON COMMITbehavior retained with a temporary table definition.- OnConflict
Action - Overriding
Kind - Which value an
INSERTwrites to an identity column it supplies a value for. Without the clause a supplied value is written to aGENERATED BY DEFAULTidentity column and rejected for aGENERATED ALWAYSone. - Partition
Bound - Partition
Range Datum - Partition
Strategy - Range
Function Operation - Operation selected for one typed range or multirange call.
- Range
Subtype - Relation
Persistence PostgreSQL’spg_class.relpersistencecontract.- Role
Attribute - Role
Membership Action - Role
Specification - Routine
Config Action - Routine
Revoke Behavior - Routine
Variadic Mode - Call syntax selected for a routine’s variadic parameter.
- Rule
Event - Schema
Authorization - Schema
Privilege - One requested schema privilege. Unsupported names survive compilation so execution can preserve
PostgreSQLtarget- and role-resolution precedence. - Schema
Revoke Behavior - Dependency behavior for schema privilege revocation.
- Sequence
Bound ALTER SEQUENCEbound action, distinguishing omission fromNO MINVALUEorNO MAXVALUE.- Sequence
Data Type - Sequence
Lifecycle - Name or namespace lifecycle action carried by
ALTER SEQUENCE. - Sequence
Option Value - A sequence option’s value as the parser keeps it, before it is read as a 64-bit integer.
- Sequence
Ownership OWNED BYaction carried byCREATE SEQUENCEandALTER SEQUENCE.- Sequence
Privilege - One requested sequence privilege. Unsupported names survive compilation so execution can preserve
PostgreSQLtarget- and role-resolution precedence. - Sequence
Restart - Physical restart action carried by
ALTER SEQUENCE. - Sequence
Revoke Behavior - Dependency behavior for sequence privilege revocation.
- SetOp
Kind - Statement
- Table
KeyConstraint Kind - Table
Lock Mode - Explicit table-lock modes; compatibility is owned by the execution lock manager.
- Table
Privilege - One requested ordinary-table privilege.
- Table
Revoke Behavior - Dependency behavior for ordinary-table privilege revocation.
- Transaction
Isolation Level - Transaction
Stmt - Trigger
Deferrability - Trigger
Event - Trigger
Timing - Vacuum
Option Value - Window
Reference Kind
Functions§
- is_
builtin_ aggregate_ function - Return whether
nameis a built-in aggregate understood by the planner.
Type Aliases§
- Generated
Function Dependency - Value
Expr Exprrestricted to value-producing forms used byINSERTrows.