PostgreSQL can be extended to support new data types. You can define new base types, which are data types defined below the level of the SQL language.
Use the PostgreSQL User Defined Type Editor to define a user-defined type in PostgreSQL physical model.
To define a PostgreSQL user-defined type
An instance of User Defined Type is created.
The PostgreSQL User Defined Type Editor opens.
Note: Click New on the toolbar to create a user-defined type. Use the Enter filter text box to filter a very large list of user-defined types to quickly locate the one that you want to define.
Specifies the name of the user-defined type. Change the name of the user-defined type in this field.
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
Specifies the user-defined type. Select Select the type from the drop-down list.
Specifies the schema of the database to which the user-defined type belongs. Select the schema from the drop-down list or click New to create one.
Specifies the role or user that owns the user-defined type. Select the owner from the drop-down list or click New to create one.
Specifies value for the Enumerated Type in the form of a static, ordered set of values.
Specifies the name of the element type that the range type will represent ranges of.
Specifies the name of a difference function for the subtype.
Specifies the canonicalization function for the range type.
Specifies the desired collation in cases where one wants to use a non-default collation in the range's ordering. Select a collation from the drop-down list or click New to create one.
Specifies the name of a function that converts data from the type's external textual form to its internal form.
Specifies the name of a function that converts data from the type's internal form to its external textual form.
Specifies the name of a function that converts data from the type's external binary form to its internal form. Select a function from the drop-down list or click New to create one.
Specifies the name of a function that converts data from the type's internal form to its external binary form. Select a function from the drop-down list or click New to create one.
Specifies the name of a function that converts an array of modifier(s) for the type into internal form. Select a function from the drop-down list or click New to create one.
Specifies the name of a function that converts the internal form of the type's modifier(s) to external textual form. Select a function from the drop-down list or click New to create one.
Specifies the name of a function that performs statistical analysis for the data type. Select a function from the drop-down list or click New to create one.
Specifies a numeric constant that indicates the length in bytes of the new type's internal representation. The default assumption is that it is variable-length.
Indicates that values of the data type are passed by value, rather than by reference.
Specifies the storage alignment requirement of the data type. If specified, it must be char, int2, int4, or double; the default is int4. Select a storage alignment from the drop-down list.
Specifies the storage strategy for the data type. If specified, must be plain, external, extended, or main; the default is plain. Select a storage strategy from the drop-down list.
Specifies the name of an existing data type that the new type will have the same representation as. Select a data type from the drop-down list or click New to create one.
Specifies the category code (a single ASCII character) for the type. Select a category code from the drop-down list.
Specifies whether the type is a preferred type within its type category. The default is false.
Specifies the default value for the data type. If this is omitted, the default is null.
Indicates that the type being created is an array; this specifies the type of the array elements. Select a user-defined type from the drop-down list or click New to create one.
Specifies the delimiter character to be used between values in arrays made of this type.
Specifies whether the type's operations can use collation information. The default is false.
The user-defined type is defined and the PostgreSQL User Defined Type Editor closes.
For more information, refer to PostgreSQL documentation.
Copyright © 2017 erwin Inc.
All rights reserved.
|
|