pub enum UserDefinedTypeSqlDefinitionOption {
Show 19 variants
Input(ObjectName),
Output(ObjectName),
Receive(ObjectName),
Send(ObjectName),
TypmodIn(ObjectName),
TypmodOut(ObjectName),
Analyze(ObjectName),
Subscript(ObjectName),
InternalLength(UserDefinedTypeInternalLength),
PassedByValue,
Alignment(Alignment),
Storage(UserDefinedTypeStorage),
Like(ObjectName),
Category(char),
Preferred(bool),
Default(Expr),
Element(DataType),
Delimiter(String),
Collatable(bool),
}Expand description
Options for PostgreSQL CREATE TYPE ... (<options>) statement (base type definition).
Base types are the lowest-level data types in PostgreSQL. To define a new base type, you must specify functions that convert it to and from text representation, and optionally binary representation and other properties.
Note: This syntax uses parentheses directly after the type name, without the AS keyword.
§PostgreSQL Documentation
See: https://www.postgresql.org/docs/current/sql-createtype.html
§Examples
CREATE TYPE complex (
INPUT = complex_in,
OUTPUT = complex_out,
INTERNALLENGTH = 16,
ALIGNMENT = double
);Variants§
Input(ObjectName)
Function to convert from external text representation to internal: INPUT = input_function
Output(ObjectName)
Function to convert from internal to external text representation: OUTPUT = output_function
Receive(ObjectName)
Function to convert from external binary representation to internal: RECEIVE = receive_function
Send(ObjectName)
Function to convert from internal to external binary representation: SEND = send_function
TypmodIn(ObjectName)
Function to convert type modifiers from text array to internal form: TYPMOD_IN = type_modifier_input_function
TypmodOut(ObjectName)
Function to convert type modifiers from internal to text form: TYPMOD_OUT = type_modifier_output_function
Analyze(ObjectName)
Function to compute statistics for the data type: ANALYZE = analyze_function
Subscript(ObjectName)
Function to handle subscripting operations: SUBSCRIPT = subscript_function
InternalLength(UserDefinedTypeInternalLength)
Internal storage size in bytes, or VARIABLE for variable-length: INTERNALLENGTH = { internallength | VARIABLE }
PassedByValue
Indicates values are passed by value rather than by reference: PASSEDBYVALUE
Alignment(Alignment)
Storage alignment requirement (1, 2, 4, or 8 bytes): ALIGNMENT = alignment
Storage(UserDefinedTypeStorage)
Storage strategy for varlena types: STORAGE = storage
Like(ObjectName)
Copy properties from an existing type: LIKE = like_type
Category(char)
Type category for implicit casting rules (single char): CATEGORY = category
Preferred(bool)
Whether this type is preferred within its category: PREFERRED = preferred
Default(Expr)
Default value for the type: DEFAULT = default
Element(DataType)
Element type for array types: ELEMENT = element
Delimiter(String)
Delimiter character for array value display: DELIMITER = delimiter
Collatable(bool)
Whether the type supports collation: COLLATABLE = collatable
Trait Implementations§
Source§impl Clone for UserDefinedTypeSqlDefinitionOption
impl Clone for UserDefinedTypeSqlDefinitionOption
Source§fn clone(&self) -> UserDefinedTypeSqlDefinitionOption
fn clone(&self) -> UserDefinedTypeSqlDefinitionOption
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for UserDefinedTypeSqlDefinitionOption
impl<'de> Deserialize<'de> for UserDefinedTypeSqlDefinitionOption
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>,
Source§impl Ord for UserDefinedTypeSqlDefinitionOption
impl Ord for UserDefinedTypeSqlDefinitionOption
Source§fn cmp(&self, other: &UserDefinedTypeSqlDefinitionOption) -> Ordering
fn cmp(&self, other: &UserDefinedTypeSqlDefinitionOption) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for UserDefinedTypeSqlDefinitionOption
impl PartialEq for UserDefinedTypeSqlDefinitionOption
Source§fn eq(&self, other: &UserDefinedTypeSqlDefinitionOption) -> bool
fn eq(&self, other: &UserDefinedTypeSqlDefinitionOption) -> bool
self and other values to be equal, and is used by ==.