Skip to main content
Version: 2.0.0 (latest)

3.1. Database

This object is the basis of modeling and represents the database to be created in a PostgreSQL server as well as the model itself. All objects manipulated in pgModeler are directly or indirectly linked to it, meaning that some operations applied to the database object can affect some of its children. Database objects are unique instances and can't be copied from one model to another. The first two tabs of the database's dialog, General and Attributes, contain the following fields:

ch3.database-dialog.general12

General
#FieldDescription
1Tablespace

The default tablespace of the database itself (TABLESPACE in CREATE DATABASE), used by PostgreSQL for the objects created in it that don't specify one. It does not affect the objects created in the model; for that, use the default objects in the next tab.

2Owner

The role that owns the database (OWNER in CREATE DATABASE). It does not affect the objects created in the model; for that, use the default objects in the next tab.

ch3.database-dialog.attributes123456789

Attributes
#FieldGroup boxDescription
1Template database

The name of the template database from which to create the new database. If this field is left empty, then the default template template1 is used.

2Model author

Name of the person who designed the model. The value specified here will be shown as a comment entry in the SQL definition of the model.

3Encoding

The charset to be used in the database. If the Default value is used, then the charset will be configured by PostgreSQL depending on its settings.

4Connection(s)

The number of simultaneous connections that the database accepts. The default value -1 indicates that there is no limit for concurrent connections.

5LC_COLLATE

Specifies in which language the string sorting must be applied. The values listed in this field are platform-dependent, so if you don't know what value to use, it's safe to leave it as Default. You can even specify a value not listed in this field; just type the desired value and it will override any value configured previously.

6LC_CTYPE

Specifies in which language the character categorization (upper, lower, and digit) must be applied. The values listed in this field are platform-dependent, so if you don't know what value to use, it's safe to leave it as Default. You can even specify a value not listed in this field; just type the desired value and it will override any value configured previously.

7Allow connectionsOptions

Indicates whether the database should allow clients to connect to it.

8Is templateOptions

Indicates whether the database is a template one.

9Generate SQL of disabled objectsOptions

Indicates whether the SQL definition of objects with code disabled must appear in the whole database definition script. This option, when unchecked, is useful to reduce the size of the SQL script that defines the whole database since it'll exclude commented SQL code that defines disabled objects.

There is another tab in the database editing form where default objects can be configured. Default objects are the ones that will be assigned to objects each time a new one is constructed. The default objects can be collation, schema, owner, and tablespace.

ch3.database-dialog.default-objects1234

Default objects
#FieldDescription
1Collation

Default collation assigned to any object created in the database model that makes use of this kind of object.

2Tablespace

Default tablespace assigned to any object created in the database model that makes use of this kind of object.

3Schema

Default schema assigned to any object created in the database model that makes use of this kind of object.

4Owner

Default owner assigned to any object created in the database model that makes use of this kind of object.

The editing form of the database, like the one of every other object, also has the tabs Associations and SQL preview, described in the introduction of this chapter.

References​

Database DDL
https://postgresql.org/docs/current/static/sql-createdatabase.html