Skip to main content

PgAttribute

Struct PgAttribute 

Source
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: SmolStr

oid (references pg_class.oid) The table this column belongs to

§attname: SmolStr

name The column name

§atttypid: SmolStr

oid (references pg_type.oid) The data type of this column (zero for a dropped column)

§attnum: u16

int2 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: u16

int2 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: bool

bool This represents a not-null constraint.

§atthasdef: bool

bool 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: bool

bool 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: bool

bool This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously.

§attinhcount: u16

int2 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

Source§

fn clone(&self) -> PgAttribute

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PgAttribute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PgAttribute

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<PgAttribute, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PgAttribute

Source§

fn eq(&self, other: &PgAttribute) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PgAttribute

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PgAttribute

Source§

impl StructuralPartialEq for PgAttribute

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,