Enumerated type – Enum – PostgreSQL

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

Other object - toolbar

You can also add new object via context menu:

context menu

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

#

Quick links

Download Buy Now!

Blog Categories
Blog by Platforms