To run tests for pglogrepl, you must configure a PostgreSQL instance with replication permissions and specific settings.
1. Database and User Setup
Create a dedicated database and a user with the replication attribute:
create database pglogrepl;
create user pglogrepl with replication password 'secret';
If you are using PostgreSQL 15 or newer, you may need to grant access to the public schema for testing purposes:
grant all on schema public to pglogrepl;
2. Configure pg_hba.conf
Add a replication entry to your pg_hba.conf to allow the replication user to connect (example for local connection):
host replication pglogrepl 127.0.0.1/32 md5
3. Configure postgresql.conf
Ensure the following settings are applied in postgresql.conf:
wal_level = logical
max_wal_senders = 5
max_replication_slots = 5