Enumerated type - Enum - PostgreSQL

Enumerated types in PostgreSQL projects can be created as reusable objects. In the main toolbar click Other and select Enum from the drop-down.

PostgreSQL other objects

Then click the diagram area to place a new graphical representative to the desired position.

In the right-side panel, you can specify the Name for the Enum type and Enum values.

PostgreSQL Enum - definition

If you wish to see the generated code, click tab Script in the right-side panel.

PostgreSQL enum - script

How to use the Enum type in your PostgreSQL project?

Enumerated types can be selected in the same way as standard data types. You can pick the Enum type from the datatype drop-down. 

Tip: A default value can be defined for the column. Expand the column detail by clicking the arrow icon and specify the value in the Default value field.

PostgreSQL enum and default value

 Generated SQL for the selected table:

Enum - postgresql table with enumerated type

#

Copyright: 2020 Datensen. All rights reserved.
This website uses cookies to ensure you get the best experience on our website.