Installing PostgreSQL and creating databases

You can install and configure PostgreSQL software and create one or more instances for your environment.

Procedure

To install PostgreSQL and create database instances:

  1. Install the PostgreSQL software.
    Many vendors and software as a service offerings are available sources of a PostgreSQL instance. You can also download and install PostgreSQL at https://www.postgresql.org/download/ External link opens a new window or tab. The Content Cortex qualifies its services using the PostgreSQL from that download.
  2. Login as superuser or check for special CREATEDB privilege to create database in the next step.
  3. Create a database to use with an object store by using the sample set of psql commands:

    The required encoding of UTF8 is included but the locale settings are omitted. For the locale settings, the default values for these categories used are those determined when initdb was run.

    Tip: PostgreSQL is case sensitive and only accepts identifiers as lowercase.
    If the ce_db_user is not the database owner, the required privileges for the database must be granted as shown in this example:
    GRANT CONNECT, SELECT, INSERT, UPDATE, CREATE, TEMPORARY, EXECUTE, USAGE ON DATABASE os1db TO ceuser;
    When creating the databases for your Content Cortex domain, it is recommended to create a database using template0 to ensure if contains only the standard objects predefined by your version of PostgreSQL. This approach is useful if you wish to avoid copying any installation-local objects that might have been added to template1. In particular, template0 should be used to allow the required encoding and locale settings. For example a statement of this form if the default locale is sufficient:
    CREATE DATABASE <database name> OWNER ce_db_user TEMPLATE template0 ENCODING UTF8;
    CREATE DATABASE os1db OWNER ceuser TEMPLATE template0 ENCODING UTF8;
    REVOKE CONNECT ON DATABASE os1db FROM public;