Skip to main content

Module locking

Module locking 

Source
Expand description

Row-lock target resolution and the physical LockRows operator.

Re-exports§

pub use context::RowLockContext;

Modules§

context
Capabilities required by query tuple locking, separated by state ownership.

Structs§

LockRows
ResolvedRowLock

Functions§

apply_propagated_view_lock
Apply a row mark selected for a stored view to the view plan before execution. Stored view plans are not present when the SQL compiler pushes row marks into derived tables, so runtime expansion must perform the same propagation to ensure an outer NOWAIT or SKIP LOCKED policy is merged before an inner row mark can block.
attach_lock_rows
lock_explained_relations
Hold the explained statement’s relation identities before collecting physical metadata or executing ANALYZE.
lock_query_relations
Acquire PostgreSQL AccessShareLock equivalents for every concrete table referenced by a query. The locks are transaction-scoped, so a cursor declaration keeps its bound relations alive until commit while ordinary persistent statements keep DDL from changing a source during execution.
query_has_row_locks
resolve_row_locks
validate_query_row_locks
Resolve cursor row-lock targets without opening or pulling the query. PostgreSQL performs these declaration-time checks even though expression evaluation and tuple locking wait until FETCH.