Skip to content

sql: support user-defined types #25123

@knz

Description

@knz

ie. CREATE TYPE T AS ... and CREATE DOMAIN T AS

Multiple variants:

Special note:

Whenever a user-defined type is created (with CREATE TYPE), PostgreSQL automatically creates an associated array type, whose name consists of the element type's name prepended with an underscore, and truncated if necessary to keep it less than NAMEDATALEN bytes long. (If the name so generated collides with an existing type name, the process is repeated until a non-colliding name is found.) This implicitly-created array type is variable length and uses the built-in input and output functions array_in and array_out. The array type tracks any changes in its element type's owner or schema, and is dropped if the element type is.

Jira issue: CRDB-5728

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-datatypesSQL column types usable in table descriptors.A-sql-pgcompatSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityX-anchored-telemetryThe issue number is anchored by telemetry references.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions