pub struct Relation {Show 22 fields
pub oid: u32,
pub file: u32,
pub name: String,
pub namespace: u32,
pub kind: RelKind,
pub owner: u32,
pub row_type: u32,
pub columns: Vec<Column>,
pub has_index: bool,
pub has_triggers: bool,
pub toast: u32,
pub index: Option<IndexInfo>,
pub sequence: Option<SequenceInfo>,
pub view: Option<ViewInfo>,
pub options: Vec<String>,
pub acl: Option<Vec<String>>,
pub replica_identity: u8,
pub unlogged: bool,
pub partition_key: Option<PartitionKey>,
pub partition_of: Option<PartitionOf>,
pub inherits: Vec<u32>,
pub of_type: u32,
}Expand description
A relation: a table, an index, a sequence or a TOAST table.
Fields§
§oid: u32The OID.
file: u32relfilenode of a relation with storage other than a sequence: the OID of the relation, and a new OID after a rebuild such as REINDEX. A sequence has its file in SequenceInfo::file.
name: StringThe name.
namespace: u32The OID of the schema.
kind: RelKindThe kind.
owner: u32The OID of the owner role.
row_type: u32The OID of the row type, or 0 for an index or a sequence.
columns: Vec<Column>The columns, in the order of their numbers.
has_index: boolrelhasindex: true after the first index on the table.
has_triggers: boolrelhastriggers: true after the first foreign key that refers to the table or that the table has.
toast: u32reltoastrelid: the OID of the TOAST table, or 0.
index: Option<IndexInfo>The facts of an index.
sequence: Option<SequenceInfo>The facts of a sequence.
view: Option<ViewInfo>The query of a view.
options: Vec<String>reloptions: each option as name=value.
acl: Option<Vec<String>>relacl: the items of the aclitem[] value in their text form, or None for the default privileges of the owner.
replica_identity: u8relreplident: d, n, f or i, or 0 for the default of the kind of the relation.
unlogged: boolTrue when relpersistence is u. The rows of an unlogged table are kept as the rows of the other tables. A temporary relation has t because of its schema.
partition_key: Option<PartitionKey>The partition key of a partitioned table, one row of pg_partitioned_table.
partition_of: Option<PartitionOf>The parent table and the bound of a partition.
inherits: Vec<u32>The parent tables of INHERITS: the parent at index i has inhseqno i + 1. NO INHERIT leaves 0 in the place of the parent, so the other parents keep their numbers. A partition has its parent in Relation::partition_of.
of_type: u32reloftype: the composite type of a typed table, or 0.