Visualization of existing PostgreSQL databases

All database connections are available in the Connections section. To create a new connection, click the Connections button on the main toolbar, and then click Create New Connection. A new modal form opens. Select PostgreSQL and enter the connection details.

When you are finished, click the Save Connection button.

Database connections

Your new PostgreSQL connection will appear in the list of all database connections.… Read the rest

How to generate SQL script for PostgreSQL

To generate SQL scripts from your PostgreSQL project click the SQL Script icon on the main toolbar. New modal opens. Click Save Script and select a location where the file should be stored. Option Overwrite existing files allows you to ignore existing scripts and overwrite them without getting a warning.

Generated PostgreSQL SQL script

#

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.… Read the rest

PostgreSQL ER diagram – graphics

Graphics for PostgreSQL entity relationship diagrams (ER Diagram) can be defined on two different levels.
Global graphics can be specified on a project level and specifics properties also on selected object level.

Colors and graphics defined on the project level

If you wish to change background color, line color or footer color (e.g.… Read the rest

PostgreSQL database design in Moon Modeler

Quick start guide for PostgreSQL database design in Moon Modeler.

1. New project

To create a new project, click New on the main toolbar and select the PostgreSQL project type.

New project for PostgreSQL

2. Add tables

Basic database objects can be added to your project/diagram by clicking the appropriate icon on the main toolbar.… Read the rest

MongoDB vs PostgreSQL

Making a comparison of document-based database systems like MongoDB and traditional relational databases like PostgreSQL is not a simple task. In fact, it is impossible to recommend one database platform, because everything depends on your requirements and the goals you wish to achieve. For some use cases, MongoDB can be the preferred solution, for many other use cases PostgreSQL can be the better option.… Read the rest

Primary key vs unique key

What is the difference between primary and unique keys?

What primary keys are and what they are used for is explained in the article describing the difference between primary and foreign keys.

A short summary: Primary keys serve as the identifier of a unique record, it can be unique information, such as a driver’s license number, telephone number including area code, car VIN number, etc.Read the rest

Primary key vs foreign key

What is the difference between primary and foreign keys in relational databases?

Primary keys serve as the identifier of a unique record in a database table. It can be unique information, such as a driver’s license number, telephone number including area code, car VIN number, etc.

 

Primary key - driving license
CREATE TABLE `ecommerce`.`customer` ( 
   `driving_license` VARCHAR(100),
   `name` VARCHAR(150) NOT NULL,
   `surname` VARCHAR(150) NOT NULL,
   `email` VARCHAR(150),
   `phone` VARCHAR(200),
    PRIMARY KEY `Primary key`(
   `driving_license`
    )
)
 ENGINE = InnoDB;

Multi-column primary keys

A primary key can contain one or more columns.Read the rest