# Prerequisites

The following section describes the prerequisites for working with the Qlik Replicate PostgreSQL source endpoint.[](https://help.qlik.com/en-US/replicate/Content/Replicate/Main/PostgreSQL/prereq_postgresql_source.htm)

## Client side

### Replicate for Windows

Install PostgreSQL ODBC Driver psqlodbc\_17\_xx\_xxxx-x64 on the Replicate machine.

Information noteMake sure to add the psql.exe path (for example, "C:\Program Files\PostgreSQL\17xx\bin") to the system PATH.

### Replicate for Linux

Download PostgreSQL 17 ODBC driver, and client programs and libraries.

* Example PostgreSQL ODBC file name: postgresql17-odbc-17.00.0006-1PGDG.rhel8.x86\_64.rpm
* PostgreSQL client programs and libraries file name: postgresql17-17.00.0006-1PGDG.rhel&lt;version&gt;.x86\_64.rpm

Then, open a shell prompt and do the following:

1. Stop the Replicate service and optionally confirm that it has stopped as described in [Replicate server procedures](https://help.qlik.com/en-US/replicate/November2025/Content/Replicate/Main/Installation/Server_Procedures.htm).

2. Install PostgreSQL 17 client programs and libraries.

3. Install the ODBC driver for PostgreSQL 17.

4. Change the working directory to &lt;Replicate-Install-Dir&gt;/bin.

5. 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-17/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.

6. Optionally, confirm that the driver location was copied:

   ```
   cat site_arep_login.sh
                           
   ```

7. 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-17/lib/psqlodbc.so`

   `Setup = /usr/pgsql-17/lib/psqlodbcw.so`

   `UsageCount = 1`

8. Start the Replicate service and optionally confirm that it has started as described in [Replicate server procedures](https://help.qlik.com/en-US/replicate/November2025/Content/Replicate/Main/Installation/Server_Procedures.htm).

## 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, see the Replication section under Server Configuration in the [PostgreSQL online help](https://www.postgresql.org/docs/).

## Required permissions

The user specified in the endpoint connection settings must be granted the following permissions on the PostgreSQL database:

* For Full Load tasks: Standard SELECT

* For CDC tasks: Superuser

  See also [Using an account without the "superuser" role](https://help.qlik.com/en-US/replicate/November2025/Content/Replicate/Main/PostgreSQL/superuser_not.htm).