Postgres Schema Types
PostgreSQL enum, composite, range, and domain types.
The Types subview of Schema Structure lists the user-defined types in a PostgreSQL schema. Select a type to see and edit its definition.

Editing a Type #
What you can edit depends on the kind of type:
| Kind | Editable | Read-only |
|---|---|---|
| Enum | Labels | The order of existing labels. |
| Composite | Attributes | |
| Range, Multirange | Owner and comment only | Subtype and range functions. |
| Domain | Check constraints | Base type, default, and NOT NULL. |
For every kind, the Owner and Comment can be changed, and changes are applied automatically.
Changes to labels, attributes, and constraints are collected until you click Apply, or Revert.
To change a type's definition
-
Select the type in the list.
-
In the detail pane, add, rename, or remove labels, attributes, or check constraints. Nothing is sent to the server yet.
-
Click Apply to run the changes, or Revert to discard them.
You'll be asked to apply or discard pending changes before switching to another type.
Adding and Removing Types #
The and buttons below the list create and drop types.
| Kind | Choose when creating |
|---|---|
| Enum, Composite | Just the Name. Add the labels or attributes afterward. |
| Range | The Name and the Subtype whose values it spans. |
| Domain | The Name and the Base Type it builds on. Add check constraints afterward. |
To create a type
-
Click below the list.
-
Enter a Name. Choose the Kind.
-
For a range or domain, also choose its Subtype or Base Type.
-
Click "Add Type"
-
For an enum, composite, or domain, you would next add its labels, attributes, or check constraints in the detail pane, then click Apply.
To drop a type
-
Select the type in the list.
-
Click .
-
Confirm the alert.