Enum UserDefinedTypeSqlDefinitionOption
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
);Function to convert from external text representation to internal: INPUT = input_function
Function to convert from internal to external text representation: OUTPUT = output_function
Function to convert from external binary representation to internal: RECEIVE = receive_function
Function to convert from internal to external binary representation: SEND = send_function
Function to convert type modifiers from text array to internal form: TYPMOD_IN = type_modifier_input_function
Function to convert type modifiers from internal to text form: TYPMOD_OUT = type_modifier_output_function
Function to compute statistics for the data type: ANALYZE = analyze_function
Function to handle subscripting operations: SUBSCRIPT = subscript_function
Internal storage size in bytes, or VARIABLE for variable-length: INTERNALLENGTH = { internallength | VARIABLE }
Indicates values are passed by value rather than by reference: PASSEDBYVALUE
Storage alignment requirement (1, 2, 4, or 8 bytes): ALIGNMENT = alignment
Storage strategy for varlena types: STORAGE = storage
Copy properties from an existing type: LIKE = like_type
Type category for implicit casting rules (single char): CATEGORY = category
Whether this type is preferred within its category: PREFERRED = preferred
Default value for the type: DEFAULT = default
Element type for array types: ELEMENT = element
Delimiter character for array value display: DELIMITER = delimiter
Whether the type supports collation: COLLATABLE = collatable