3.3 Configuring a Package Installation

Table of Contents Previous Next


3 Using a Package Manager to Install Advanced Server : 3.3 Configuring a Package Installation

The PostgreSQL initdb command creates a database cluster. If you are using an RPM package to install Advanced Server, you must manually configure the service and invoke initdb to create your cluster.
When invoking initdb, you can:
Include the service command on RHEL or CentOS 6.x, and use service configuration file to configure the environment.
Include the systemd service manager on RHEL or CentOS 7.x use the service configuration file to configure the environment.
If you are using the interactive graphical installer to install Advanced Server, the installer will invoke initdb to create a cluster for you; for details about specifying cluster preferences when using the interactive installer, see Setting Cluster Preferences with the Graphical Installer in Chapter 4.
To create a database cluster in the PGDATA directory that listens on the port specified by the PGPORT specified in the service configuration file described in Section 3.3.2, assume root privileges, and invoke the service script:
You can also assign a locale to the cluster when invoking initdb. By default, initdb will use the value specified by the $LANG operating system variable, but if you append a preferred locale when invoking the script, the cluster will use the alternate value. For example, to create a database cluster that uses simplified Chinese, invoke the command:
To invoke initdb on a RHEL or CentOS 7.x system, with the options specified in the service configuration file, assume the identity of the operating system superuser:
/usr/edb/as10/bin/edb-as-10-setup initdb
After creating the cluster, use systemctl to start, stop, or restart the service:
On a CentOS or RedHat version 6.x host, the RPM installer creates a service configuration file named edb-as-10.sysconfig in /etc/sysconfig/edb/as10. Please note that options specified in the service configuration file are only enforced if initdb is invoked via the service command; if you manually invoke initdb (at the command line), you must specify the other options (such as the location of the data directory and installation mode) on the command line.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\ab78fd00\one.png
PGENGINE specifies the location of the engine and utility executable files.
PGPORT specifies the listener port for the database server.
PGDATA specifies the path to the data directory.
PGLOG specifies the location of the log file to which the server writes startup information.
Use INITDBOPTS to specify any initdb option or options that you wish to apply to the new cluster.
You can modify the edb-as-10.sysconfig file before using the service command to invoke the startup script to change the listener port, data directory location, startup log location or installation mode. If you plan to create more than one instance on the same system, you may wish to copy the edb-as-10.sysconfig file (and the associated edb-as-10 startup script) and modify the file contents for each additional instance that resides on the same host.
You can use the INITDBOPTS variable to specify your cluster configuration preferences. By default, the INITDBOPTS variable is commented out in the service configuration file; unless modified, when you run the service startup script, the new cluster will be created in a mode compatible with Oracle databases. Clusters created in this mode will contain a database named edb, and have a database superuser named enterprisedb.
To create a new cluster in PostgreSQL mode, remove the pound sign (#) in front of the INITDBOPTS variable, enabling the "--no-redwood-compat" option. Clusters created in PostgreSQL mode will contain a database named postgres, and have a database superuser named postgres.
You may also specify multiple initdb options. For example, the following statement:
Creates a database cluster (without compatibility features for Oracle) that contains a database named postgres that is owned by a user named alice; the cluster uses UTF-8 encoding.
Include the --no-redwood-compat keywords to instruct the server to create the cluster in PostgreSQL mode. When the cluster is created in PostgreSQL mode, the name of the database superuser will be postgres, the name of the default database will be postgres, and Advanced Server’s features compatible with Oracle databases will not be available to the cluster.
Include the --redwood-like keywords to instruct the server to use an escape character (an empty string ('')) following the LIKE (or PostgreSQL-compatible ILIKE) operator in a SQL statement that is compatible with Oracle syntax.
Include the --icu-short-form keywords to create a cluster that uses a default ICU (International Components for Unicode) collation for all databases in the cluster. For more information about Unicode collations, please refer to the EDB Postgres Advanced Server Guide available at:
For more information about using initdb, and the available cluster configuration options, see the PostgreSQL Core Documentation available at:
You can also view online help for initdb by assuming superuser privileges and entering:
/path_to_initdb_installation_directory/initdb --help
Where path_to_initdb_installation_directory specifies the location of the initdb binary file.
On a CentOS or RedHat version 7.x host, the unit file is named edb-as-10.service and resides in /usr/lib/systemd/system. The unit file contains references to the location of the Advanced Server data directory. You should avoid making any modifications directly to the unit file because it may be overwritten during package upgrades.
By default, data files reside under /var/lib/edb/as10/data directory. To use a data directory that resides in a non-default location, create a copy of the unit file under the /etc directory:
After copying the unit file to the new location, modify the service file (/etc/systemd/system/edb-as-10.service) with your editor of choice, correcting any required paths.
Then, use the following command to reload systemd, updating the modified service scripts:

3 Using a Package Manager to Install Advanced Server : 3.3 Configuring a Package Installation

Table of Contents Previous Next