UserDefinedTypeInternalLength in sqlparser::ast - Rust

Enum UserDefinedTypeInternalLength 

Source

pub enum UserDefinedTypeInternalLength {
    Fixed(u64),
    Variable,
}
Expand description

Internal length specification for PostgreSQL user-defined base types.

Specifies the internal length in bytes of the new type’s internal representation. The default assumption is that it is variable-length.

§PostgreSQL Documentation

See: https://www.postgresql.org/docs/current/sql-createtype.html

§Examples

CREATE TYPE mytype (
    INPUT = in_func,
    OUTPUT = out_func,
    INTERNALLENGTH = 16  -- Fixed 16-byte length
);

CREATE TYPE mytype2 (
    INPUT = in_func,
    OUTPUT = out_func,
    INTERNALLENGTH = VARIABLE  -- Variable length
);
§

Fixed internal length: INTERNALLENGTH = <number>

§

Variable internal length: INTERNALLENGTH = VARIABLE

§
§
§
§
§
§