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.
|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.
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
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:
specifies the location of the engine and utility executable files.
specifies the listener port for the database server.
specifies the path to the data directory.
specifies the location of the log file to which the server writes startup information.
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
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
specifies the location of the initdb
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