Skip to main content

Module partition

Module partition 

Source
Expand description

Declarative partition validation, value comparison, and routing semantics.

Structs§

PartitionContext
PartitionTreeNode
A partition and the partitioned table it belongs to.

Enums§

PartitionRejection
Why partition routing rejects a row. The executor reports each with a description of the row, which depends on the statement and the role that writes it.
PartitionRoute
Where a row that a statement writes through a relation is stored.

Traits§

PartitionCatalog
Hierarchy definitions needed to validate and route a row; no storage writes are exposed.
PartitionExpressions
Evaluate declared partition keys and bounds with the caller’s expression scope.

Functions§

foreign_key_scan_tables
The relations whose rows a foreign key reads for table: the table and, when it is partitioned, every partition below it, each before its own partitions. The rows of a plain inheritance child belong to the child alone, as PostgreSQL’s referential queries read ONLY a table that is not partitioned.
partition_ancestor_tables
The relation followed by each partitioned table it is a partition of, nearest first. A foreign key that references a table which is not partitioned reads ONLY that table, as PostgreSQL’s referential queries do, so plain inheritance parents are not among them.
partition_bound_order
The names of partitions, which are siblings, in the order of PostgreSQL’s partition descriptor: range partitions by lower bound, list partitions by their smallest value followed by a partition that holds only NULL, hash partitions by modulus and remainder, and the default partition last.
partition_constraint_accepts_document
Evaluate a retained detached-partition CHECK without requiring a live parent edge. This is also the exact predicate used for prospective ATTACH row scans.
partition_constraint_accepts_row
Whether the row satisfies the partition constraint of table, which holds the bounds of the partition and of each of its partition ancestors (ExecPartitionCheck). A relation that is not a partition accepts every row.
partition_datum_text
Render one bound datum of partition key type ty.
partition_hierarchy_root
partition_identity_owner
Return the physical counter owner for legacy auto-increment metadata. Declarative partitions share the top partitioned parent’s counter; newly created SERIAL and identity columns use their durable sequence binding instead.
partition_key_type
Declared type of one partition key: a column’s type, or the resolved type of a key expression over the partitioned table’s columns.
partition_tree
The partitions below root, and root itself first when include_root names a partition, each before its own partitions, with siblings in partition order.
prospective_partition_bound_accepts_document
Test one stored row against a prospective direct-child bound before the hierarchy edge is installed. DEFAULT means no existing non-default sibling accepts the row, matching the routing decision the new edge will expose.
range_bound_text
get_range_partbound_string: one range bound as (datum, ...), with MINVALUE and MAXVALUE spelled out.
route_partition_insert
Route a row that an INSERT writes through requested_table, as ExecFindPartition does: a partitioned table that is itself a partition first checks its own partition constraint, and each level then selects the partition whose bound accepts the row. A relation that is not partitioned stores the row itself, without a check: ExecInsert checks the partition constraint of a partition that the statement names after its other constraints, which the caller does with partition_constraint_accepts_row.
stored_datum
The constant a transformed bound stores for one datum.
transform_partition_bound
Transform a declared bound for a new partition of parent into its stored form.
validate_hash_partition_spec
validate_new_partition_bound
Validate that bound, already transformed, can be added for partition under parent.