PostgreSQL database system for all types of databases (configuration, log, archive) is fully supported in D2000 System from version V10.0.38. In lower version V10.0.37, user may use PostgreSQL only in connection with archive databases.
To use the PostgreSQL, it must be installed on the target computer. Installation can be done in two ways either manually or through D2000 System installer, which fully installs all of necessary components of PostgreSQL.
Installation by D2000 System installer is more user-friendly. It ensures installing of all necessary components for fully integration with D2000 System. This method is mainly recommended for users who have not any experience with the PostgreSQL.
To install PostgreSQL, user must check Install the PostgreSQL in D2000 System Configuration Guide in this dialog window:
In some situations, this checkbox could be disabled, which means that installer detected PostgreSQL on computer and any other installation is not necessary. The installer does not allow to install other PostgreSQL.
If PostgreSQL installation is enabled, the installer of PostgreSQL is started along with the configurator of D2000 System. It requires to set some important parameters concerning the PostgreSQL and configure appropriate database service (see the section PostgreSQL structure). PostgreSQL installer guides the user through the dialog windows which enables to set some necessary parameters. Most of the windows contains the default value which is recommended for standard purposes.
User can install PostgreSQL also separately. For proper integration with D2000, it is necessary to install even another components according to these steps:
After installation (manual or automatic), PostgreSQL is configured and may be used in D2000 System.
D2000 System requires for its operation on PostgreSQL these programs configured correctly:
When PostgreSQL is installed through D2000 System installer, all necessary components are installed automatically.
After installation, the target computer contains the files of PostgreSQL in selected directory. For example, the utility psql.exe is placed in subdirectory bin. It allows to work with database on command line.
When installing, default PostgreSQL service with name postgresql-XXX-VV is created (where XXX defines the architecture x86/x64 and VV defines the version of database system, e.g. 9.3). This service is the main part of PostgreSQL. You may work (create databases, connect to database,...) with the database system unless this service is running.
After starting the service, PostgreSQL begin to listen on the configured network connection, the port of which was entered when installing. This interface can be changed in the configuration file of database service.
Each service has own directory (the path was defined when installing), which contains its configuration and data files.
The most important configuration files of database service are:
Most of the changes in the configuration files requires reloading of configuration by the database service. It can be done in two ways:
pg_ctl reload
SELECT pg_reload_conf();
Both these commands should not interrupt any currently executed operation or connection to the database service.
On the target computer, more than one database service can run which will listen on independent network interface / port and will contain own directory with configuration. The manual configuration of other service requires special knowledge about PostgreSQL. In D2000 System, new service can be simply created through the configuration tool D2000 Management Console.
Several independent databases can operate under one database service. Each database is identified by a unique name. Considering this fact, it is sufficient that one (default) database service runs on one computer. This service should cover several different databases. Partition of databases on several database services on one computer brings improvement of performance only in some specific situations.
In PostgreSQL, data are stored on disk to one data directory of database, which contains many data files. When creating the new database in a standard way, data directory is stored in the subdirectory of given database service. It means, when creating the new database, the new subdirectory will be created in the directory structure of its service. All data will be stored here.
In some situations, data storage into the directory structure of service is not desired. For example, if it is necessary to divide data directories of databases to separate directories. This problem can be solved by using so-called tablespaces. The tablespace represents some directory that is saved on physical disc and is defined for all database service. Tablespace can contain all database or only some entities such as tables, indexes,... In such case, data files that represent given entity (table, index,...) are stored into subdirectory of tablespace but not into directory of database service. When creating the database, user may select default tablespace. The entities can be moved between tablespaces but this feature is not described in this instruction.
The features of tablespace are also used by D2000 System, which stores data files of its databases to the application directory.
To manage PostgreSQL databases, user may use either utility psql.exe (it is placed in bin subdirectory of installation directory), which enables to browse and manage the system by command line, or graphic tool pgAdmin III, which is installed together with the database system.