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:
12
| General | ||
|---|---|---|
| # | Field | Description |
| 1 | Tablespace | The default tablespace of the database itself ( |
| 2 | Owner | The role that owns the database ( |
123456789
| Attributes | |||
|---|---|---|---|
| # | Field | Group box | Description |
| 1 | Template database | The name of the template database from which to create the new database. If this field is left empty, then the default template | |
| 2 | Model 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. | |
| 3 | Encoding | The charset to be used in the database. If the | |
| 4 | Connection(s) | The number of simultaneous connections that the database accepts. The default value | |
| 5 | LC_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 | |
| 6 | LC_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 | |
| 7 | Allow connections | Options | Indicates whether the database should allow clients to connect to it. |
| 8 | Is template | Options | Indicates whether the database is a template one. |
| 9 | Generate SQL of disabled objects | Options | 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.
1234
| Default objects | ||
|---|---|---|
| # | Field | Description |
| 1 | Collation | Default collation assigned to any object created in the database model that makes use of this kind of object. |
| 2 | Tablespace | Default tablespace assigned to any object created in the database model that makes use of this kind of object. |
| 3 | Schema | Default schema assigned to any object created in the database model that makes use of this kind of object. |
| 4 | Owner | 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