-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Special case of #25123.
Postgres' CREATE TYPE
statement can be used to add a new primitive type that is not defined based on other types. Instead the type is defined using external I/O functions that are provided in an unspecified manner, typically using primitives linked into the database via a separate programming language.
https://www.postgresql.org/docs/10/static/sql-createtype.html#id-1.9.3.90.5.8
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-4942