pub enum Statement {
Show 31 variants
Select(SelectStatement),
CreateTable(CreateTableStatement),
CreateExtension(String),
DoBlock,
CreateIndex(CreateIndexStatement),
Insert(InsertStatement),
Update(UpdateStatement),
Delete(DeleteStatement),
Begin,
Commit,
Rollback,
Savepoint(String),
RollbackToSavepoint(String),
ReleaseSavepoint(String),
ShowTables,
ShowColumns(String),
CreateUser(CreateUserStatement),
DropUser(String),
ShowUsers,
Explain(ExplainStatement),
AlterIndex(AlterIndexStatement),
AlterTable(AlterTableStatement),
CreatePublication(CreatePublicationStatement),
DropPublication(String),
ShowPublications,
CreateSubscription(CreateSubscriptionStatement),
DropSubscription(String),
ShowSubscriptions,
WaitForWalPosition {
pos: u64,
timeout_ms: Option<u64>,
},
Analyze(Option<String>),
CompactColdSegments,
}Variants§
Select(SelectStatement)
CreateTable(CreateTableStatement)
CreateExtension(String)
v7.9.15 — CREATE EXTENSION [IF NOT EXISTS] <name> [WITH SCHEMA <s>] [VERSION <v>] [CASCADE] accepted as a
no-op so PG dumps that include extension declarations
(notably pgvector) load against SPG without splitting
init scripts. mailrs migration follow-up F3.
DoBlock
v7.9.27 — PG DO $$ … $$ [LANGUAGE plpgsql]; block. SPG
has no PL/pgSQL; engine returns CommandOk no-op so
pg_dump output with idempotent DO migrations loads
against SPG without splitting scripts. The lexer
consumes the dollar-quoted body into a discarded
Token::String. mailrs migration follow-up H1.
CreateIndex(CreateIndexStatement)
Insert(InsertStatement)
Update(UpdateStatement)
v4.4 — UPDATE <table> SET col=expr [, ...] [WHERE cond].
Delete(DeleteStatement)
v4.4 — DELETE FROM <table> [WHERE cond].
Begin
Commit
Rollback
Savepoint(String)
SAVEPOINT <name> — push a named savepoint onto the active TX’s
stack so a later ROLLBACK TO <name> can undo just the work
since this point.
RollbackToSavepoint(String)
ROLLBACK TO [SAVEPOINT] <name> — restore catalog state to the
named savepoint and discard later savepoints. Does not end the
transaction.
ReleaseSavepoint(String)
RELEASE [SAVEPOINT] <name> — discard a savepoint without
rolling back. Keeps the work done since then.
ShowTables
SHOW TABLES — return the list of tables in the catalog.
ShowColumns(String)
SHOW COLUMNS FROM <table> — return one row per column with
its declared name / type / nullability.
CreateUser(CreateUserStatement)
CREATE USER 'name' WITH PASSWORD 'pw' ROLE 'admin' (v4.1).
Role is optional; defaults to readonly when omitted.
DropUser(String)
DROP USER 'name' (v4.1).
ShowUsers
SHOW USERS (v4.1) — admin-only listing of (name, role).
Explain(ExplainStatement)
v4.26 — EXPLAIN [ANALYZE] <select>. The engine returns a
single-column text table describing the rewritten plan tree
for inner. analyze triggers an actual exec to attach
observed row counts and elapsed micros to each node.
AlterIndex(AlterIndexStatement)
v6.0.4 — ALTER INDEX <name> REBUILD [WITH (encoding = ...)].
Synchronous rebuild of an NSW index. With the optional
encoding clause, every stored cell at the indexed column is
also re-encoded through coerce_value before the new graph
builds.
AlterTable(AlterTableStatement)
v6.7.2 — ALTER TABLE <name> SET <setting> = <value>.
The only setting in v6.7.2 is hot_tier_bytes, which
overrides the global SPG_HOT_TIER_BYTES freezer trigger
for the named table.
CreatePublication(CreatePublicationStatement)
v6.1.2 — CREATE PUBLICATION <name> [FOR ALL TABLES].
The catalog row lives in spg_publications. Publisher-side
WAL filtering arrives in v6.1.5.
DropPublication(String)
v6.1.2 — DROP PUBLICATION <name>. PG-compatible silent
no-op when the publication does not exist.
ShowPublications
v6.1.3 — SHOW PUBLICATIONS. Returns one row per
publication ordered by name with (name, scope_summary, table_count) columns. The scope summary is the human-
readable form ALL TABLES / FOR TABLE … / FOR ALL TABLES EXCEPT …; table_count is NULL for the
AllTables scope and the table-list length otherwise.
CreateSubscription(CreateSubscriptionStatement)
v6.1.4 — CREATE SUBSCRIPTION <name> CONNECTION '<conn>' PUBLICATION <pub_name> [, <pub_name> …]. Catalog lands
in spg_subscriptions; when the subscription is
enabled = true (default) the server spawns a
background worker that connects to conn and drains the
requested publication(s) into the local engine.
DropSubscription(String)
v6.1.4 — DROP SUBSCRIPTION <name>. Like DROP
PUBLICATION, silent no-op when absent. Stops the
associated worker thread before removing the row.
ShowSubscriptions
v6.1.4 — SHOW SUBSCRIPTIONS. Returns one row per
subscription ordered by name with (name, conn_str, publications, enabled, last_received_pos).
WaitForWalPosition
v6.1.7 — WAIT FOR WAL POSITION <pos> [WITH TIMEOUT <ms>].
Blocks until the local server’s apply position reaches
<pos> or <ms> elapses. Server-layer command: the
engine refuses it (EngineError::Unsupported) since
lag_state lives in spg-server’s ServerState.
Fields
Analyze(Option<String>)
v6.2.0 — ANALYZE [<table>]. Bare form walks every user
table; ANALYZE <name> re-stats just one. Populates
spg_statistic with per-column null_frac + n_distinct +
100-bucket equi-depth histogram.
CompactColdSegments
v6.7.3 — COMPACT COLD SEGMENTS. Walks every user table’s
BTree-cold indices and merges small cold-tier segments
(size below SPG_COMPACTION_TARGET_SEGMENT_BYTES, default
4 MiB) into a single larger segment per (table, index).
WHERE predicate filtering on which tables to compact is
carved out of v6.7.3 (per V6_7_DESIGN.md STABILITY entry);
v6.7.3 only supports the bare form.