pub struct TableHierarchy {
pub parents: Vec<String>,
pub parent_sequence_numbers: Vec<i32>,
pub partition_spec: Option<PartitionSpec>,
pub partition_bound: Option<PartitionBound>,
pub local_columns: Vec<String>,
pub partition_identity_overrides: Vec<PartitionIdentityOverride>,
pub partition_inherited_key_constraints: Vec<TableKeyConstraint>,
pub partition_inherited_foreign_keys: Vec<ForeignKey>,
}Expand description
Metadata shared by ordinary inheritance and declarative partitioning.
Fields§
§parents: Vec<String>Direct parents in declaration order. Names are parse-time identities in the statement AST and canonical catalog identities after registration.
parent_sequence_numbers: Vec<i32>Durable pg_inherits.inhseqno values aligned with parents.
Catalogs written before ALTER inheritance support leave this empty and
therefore use the declaration-order sequence 1..=parents.len().
partition_spec: Option<PartitionSpec>Partition key owned by a partitioned relation.
partition_bound: Option<PartitionBound>Bound owned by a child declared with PARTITION OF.
local_columns: Vec<String>Columns declared by this relation before inherited columns were merged into its stored row type. PostgreSQL exposes this provenance through pg_attribute.attislocal; keeping it in durable hierarchy metadata distinguishes an explicitly redeclared inherited column from a purely inherited one after reopen.
partition_identity_overrides: Vec<PartitionIdentityOverride>Original local sequence metadata hidden while an attached partition uses a parent’s identity generator. PostgreSQL keeps a pre-existing SERIAL default and restores its behavior after DETACH.
partition_inherited_key_constraints: Vec<TableKeyConstraint>Key constraints materialized during partition attachment. Local catalog identities bind provenance to the retained rows through schema changes; detachment clears external provenance while preserving the constraints.
partition_inherited_foreign_keys: Vec<ForeignKey>Foreign keys materialized during partition attachment. Local catalog identities bind provenance to each row; detachment retains the rows and separates their enforcement family from the former parent.
Implementations§
Source§impl TableHierarchy
impl TableHierarchy
pub const fn is_partition(&self) -> bool
pub fn parent_sequence_number(&self, index: usize) -> i32
pub fn next_parent_sequence_number(&self) -> i32
Trait Implementations§
Source§impl Clone for TableHierarchy
impl Clone for TableHierarchy
Source§impl Debug for TableHierarchy
impl Debug for TableHierarchy
Source§impl Default for TableHierarchy
impl Default for TableHierarchy
Source§impl<'de> Deserialize<'de> for TableHierarchy
impl<'de> Deserialize<'de> for TableHierarchy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TableHierarchy
impl RefUnwindSafe for TableHierarchy
impl Send for TableHierarchy
impl Sync for TableHierarchy
impl Unpin for TableHierarchy
impl UnsafeUnpin for TableHierarchy
impl UnwindSafe for TableHierarchy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more