Skip to main content Skip to complementary content

Prerequisites

The following section describes the prerequisites for working with the Qlik Replicate PostgreSQL source endpoint.

Client side

Replicate for Windows

PostgreSQL ODBC Driver psqlodbc_12_02_0000-x64 only must be installed on the Replicate machine.

Information noteMake sure that the psql.exe path (e.g. "C:\Program Files\PostgreSQL\1202\bin") is added to the system PATH.

Replicate for Linux

  1. Install postgresql12. For example, postgresql12-12.1-2PGDG.rhel7.x86_64.rpm is the package required for Red Hat 7.

  2. Install the ODBC driver for postgresql12.

    For example, postgresql12-odbc-12.01.0000-1PGDG.rhel7.x86_64.rpm is the client required for Red Hat 7.

  3. Copy the driver location to the site_arep_login.sh file:

    echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib64:/usr/pgsql-12/lib" >> site_arep_login.sh

    This will add the driver to "LD_LIBRARY_PATH" and update the driver location in the site_arep_login.sh file.

  4. Makes sure that the /etc/odbcinst.ini file contains an entry for PostgreSQL, as in the following example:

    [PostgreSQL]

    Description = PostgreSQL ODBC driver

    Driver = /usr/pgsql-12/lib/psqlodbc.so

    Setup = /usr/pgsql-12/lib/psqlodbcw.so

    Debug = 0

    CommLog = 1

    UsageCount = 2

Server side

  • The IP address of the Replicate machine must be added to the pg_hba.conf configuration file with the "replication" keyword in the database field.

    Example:

    host replication all 176.123.1.212/32 trust

  • Make sure that the test_decoding output plugin (found in the postgresql12-contrib package) is installed.

  • The user specified in the connection settings must be granted read-write permissions to the source database to allow the creation of "slots" on the database. The slots are required in order to read the changes.

  • The following parameters and values must be set in the postgresql.conf configuration file.

    wal_level = logical
    max_replication_slots = number of replication slots

    Where number of replication slots must be greater than one and should be set according to the number of tasks that you want to run. For example, to run five tasks you need to set max_replication_slots = 5. Slots open automatically as soon as a task starts and remain open, even when task is no longer running. Note that open slots need to be manually deleted.

    max_wal_senders = number of concurrent tasks

    Where number of concurrent tasks must be greater than one and should be set according to the number of tasks that you are running concurrently. For example, to run three tasks concurrently you need to set max_wal_senders = 3.

  • The wal_sender_timeout parameter terminates connections that are inactive longer than the specified number of milliseconds. The default timeout is 60 seconds. To disable the timeout mechanism (optional), set this parameter to zero.

    Information note

    By default, the value of the wal_sender_timeout parameter is interpreted by the server as milliseconds. To explicitly specify seconds, append an "s" to the value as in the following example:

    wal_sender_timeout=60s

For more information on the configuration parameters, visit:

https://www.postgresql.org/docs/12/runtime-config-replication.html

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!