pub struct PgAttribute {Show 24 fields
pub attrelid: SmolStr,
pub attname: SmolStr,
pub atttypid: SmolStr,
pub attnum: u16,
pub atttypmod: Option<u32>,
pub attndims: u16,
pub attcompression: Option<PgAttributeAttcompression>,
pub attnotnull: bool,
pub atthasdef: bool,
pub attidentity: Option<PgAttributeAttidentity>,
pub attgenerated: Option<PgAttributeAttgenerated>,
pub attisdropped: bool,
pub attislocal: bool,
pub attinhcount: u16,
pub attcollation: Option<SmolStr>,
pub attstattarget: Option<u16>,
pub attacl: Option<Vec<AclItem<TableColumnAclPrivilege>>>,
pub attoptions: Option<Vec<SmolStr>>,
pub attfdwoptions: Option<Vec<SmolStr>>,
pub description: Option<SmolStr>,
pub seclabel: Option<SmolStr>,
pub seclabel_provider: Option<SmolStr>,
pub initprivs: Option<Vec<AclItem<TableColumnAclPrivilege>>>,
pub initprivs_type: Option<PgAttributeInitprivsType>,
}Expand description
The DDL-only contents of pg_attribute
Fields§
§attrelid: SmolStroid (references pg_class.oid) The table this column belongs to
attname: SmolStrname The column name
atttypid: SmolStroid (references pg_type.oid) The data type of this column (zero for a dropped column)
attnum: u16int2 The number of the column. Ordinary columns are numbered from 1 up. System columns, such as ctid, have (arbitrary) negative numbers.
atttypmod: Option<u32>int4 atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod.
attndims: u16int2 Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means “it’s an array”.)
attcompression: Option<PgAttributeAttcompression>char The current compression method of the column. Typically this is ‘\0’ to specify use of the current default setting (see default_toast_compression). Otherwise, ‘p’ selects pglz compression, while ‘l’ selects LZ4 compression. However, this field is ignored whenever attstorage does not allow compression.
attnotnull: boolbool This represents a not-null constraint.
atthasdef: boolbool This column has a default expression or generation expression, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the expression. (Check attgenerated to determine whether this is a default or a generation expression.)
attidentity: Option<PgAttributeAttidentity>char If a zero byte (‘’), then not an identity column. Otherwise, a = generated always, d = generated by default.
attgenerated: Option<PgAttributeAttgenerated>char If a zero byte (‘’), then not a generated column. Otherwise, s = stored. (Other values might be added in the future.)
attisdropped: boolbool This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL.
attislocal: boolbool This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously.
attinhcount: u16int2 The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed.
attcollation: Option<SmolStr>oid (references pg_collation.oid) The defined collation of the column, or zero if the column is not of a collatable data type
attstattarget: Option<u16>int2 attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A null value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create.
attacl: Option<Vec<AclItem<TableColumnAclPrivilege>>>aclitem[] Column-level access privileges, if any have been granted specifically on this column
attoptions: Option<Vec<SmolStr>>text[] Attribute-level options, as “keyword=value” strings
attfdwoptions: Option<Vec<SmolStr>>text[] Attribute-level foreign data wrapper options, as “keyword=value” strings
description: Option<SmolStr>text The comment from pg_description
seclabel: Option<SmolStr>text The seclabel from pg_seclabel
seclabel_provider: Option<SmolStr>text The provider from pg_seclabel
initprivs: Option<Vec<AclItem<TableColumnAclPrivilege>>>aclitem[] The initial access privileges from pg_init_privs.
initprivs_type: Option<PgAttributeInitprivsType>char A code defining the type of initial privilege of this object from pg_init_privs. ‘i’ if set by initdb, ‘e’ if set by CREATE EXTENSION.
Trait Implementations§
Source§impl Clone for PgAttribute
impl Clone for PgAttribute
Source§fn clone(&self) -> PgAttribute
fn clone(&self) -> PgAttribute
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PgAttribute
impl Debug for PgAttribute
Source§impl<'de> Deserialize<'de> for PgAttribute
impl<'de> Deserialize<'de> for PgAttribute
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgAttribute, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgAttribute, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PgAttribute
impl PartialEq for PgAttribute
Source§impl Serialize for PgAttribute
impl Serialize for PgAttribute
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for PgAttribute
impl StructuralPartialEq for PgAttribute
Auto Trait Implementations§
impl Freeze for PgAttribute
impl RefUnwindSafe for PgAttribute
impl Send for PgAttribute
impl Sync for PgAttribute
impl Unpin for PgAttribute
impl UnsafeUnpin for PgAttribute
impl UnwindSafe for PgAttribute
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.