Composite types & PostgreSQL ER Diagram

In PostgreSQL, a composite type is a user-defined data type that allows you to create a structure containing multiple columns. In Luna Modeler composite types can be created as reusable objects.

PostgreSQL Composite in ER Diagram

How to add a new composite type to the PostgreSQL ER diagram

In the main toolbar click the Composite button and then click the diagram area.

Toolbar item for adding a new composite to PostgreSQL project

You can also add new composite type via context menu:

Context menu accessible from the ER diagram

Editing composite type properties

In the right-side panel, you can specify the Name for the Composite type and specify description, add columns and define other properties.

PostgreSQL Composite Properties

How to use the Composite type in your PostgreSQL project?

Composite types can be selected in the same way as standard data types. Just pick the Composite type from the datatype drop-down. 

Selection of composite in ER diagram

SQL Script

See below a screenshot that displays the SQL script generated for the PostgreSQL project

Generated SQL script for PostgreSQL composite

#

Quick links

Download Buy Now!

Blog Categories
Blog by Platforms