Base types are those, like int4, that are implemented below
the level of the SQL language (typically in a low-level language
such as C). They generally correspond to what are often known
as abstract data types. PostgreSQL can only operate on such
types through functions provided by the user and only understands
the behavior of such types to the extent that the user describes
them. Base types are further subdivided into scalar and array
types. For each scalar type, a corresponding array type is
automatically created that can hold variable-size arrays of
that scalar type.
Composite types, or row types, are created whenever the user
creates a table; it's also possible to define a "stand-alone"
composite type with no associated table. A composite type
is simply a list of base types with associated field names.
A value of a composite type is a row or record of field values.
The user can access the component fields from SQL queries.
Create a Type
To create a type :
- Select the Database in the Tree View and select Others
>
Type from the toolbar
- Press the
New Type button
- Enter Type properties and fields on the appropriate tabs
of the New Type Editor
- Click OK
Design a Type
To design a type:
- Select the Database in the Tree View and select Others
>
Type from the toolbar
- Select the type you want to design.
- Press the
Design Type button.
- Edit Type properties and fields on the appropriate tabs
of the Design Type Editor
- Click OK
Delete a Type
To delete a type:
- Select the Database in the Tree View and select Others
>
Type from the toolbar
- Select the type you want to delete.
- Click the
Delete Type button.
- Confirm deleting in the dialog window.
|