I am trying to create a logical replication between 2 postgres servers. But when I try to create a subscription from the slave to the master I get the error

ERROR: could not connect to the publisher: FATAL: no pg_hba.conf entry for replication connection from host

Here are my configs.

Master server ip; Slave server ip

Master server pg_hba.conf :

host replication replicate md5

Slave server pg_hba.conf :

host all postgres md5

User for replication is 'replicate'. On the master, I have granted database access to 'replicate'user and created the publication.

I have also done a schema dump from Master to Slave using pg_dump.

Have I missed anything here?

  • Added to the pg_hba.conf: host database replicate md5 but still getting the same error .
    – Al8877
    Commented Mar 25, 2019 at 2:12

1 Answer 1


host replication replicate md5

Logical replication needs to connect to an actual database. The special name 'replication' is only used for physical replication, not logical replication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.