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](https://www.datensen.com/blog/wp-content/uploads/postgresql-composite-in-er-diagram.png)
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](https://www.datensen.com/blog/wp-content/uploads/new-composite.webp)
You can also add new composite type via context menu:
![Context menu accessible from the ER diagram](https://www.datensen.com/blog/wp-content/uploads/postgresql-composite-diagram-context-menu.webp)
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](https://www.datensen.com/blog/wp-content/uploads/postgresql-composite-properties.png)
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](https://www.datensen.com/blog/wp-content/uploads/composite-selection-datatype.webp)
SQL Script
See below a screenshot that displays the SQL script generated for the PostgreSQL project
![Generated SQL script for PostgreSQL composite](https://www.datensen.com/blog/wp-content/uploads/composite-sql-script.webp)
#