I'm running Postgres16 on Windows server. Start researching on pg_basebackup - when I execute the following command, pg_basebackup.exe -h SERVERNAME -U postgres -p 5432 -D Z:\PostgreSQL\16\backups\ -Fp -Xs -P -R --checkpoint=fast --max-rate=1024M I'm getting the following error:

pg_basebackup: error: connection to server at "servername" port 5432 failed: FATAL: no pg_hba.conf entry for replication connection from host, user "postgres", no encryption

I think it's because I added the SSPI connections.

I have the following entries before the sspi but still getting error

host    all     all       scram-sha-256 
host    all     all    scram-sha-256 
host    all     all     ::0/0           sspi    map=sspi

How do I fix pg_hba so I can use sspi for certain usernames will able to allow connections for local logins (much like mixed mode in MSSQL)?

Thank you

1 Answer 1


The magic database name "all" does not match the magic database name "replication" used for replication connections, so there is no match in your pg_hba. You could use "all,replication" if you want to include replication connections in your existing pg_hba configuration without repeating yourself.

  • Thank you jjanes for the suggestions. I added "replication" to the host all,replication all scram-sha-256 host all,replication all scram-sha-256 , restarted service but still getting similar error.
    – Student
    Dec 19, 2023 at 14:04
  • For future reference, make sure you have "all,replication" on the user that is running the pg_basebackup. In my case, I was using an AD service account, so I had to add "all,replication" to the sspi in pg_hba.conf
    – Student
    Jan 11 at 21:03

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.