Maybe it's just too early in the morning, but I can't seem to get pg_basebackup working for a local user. This is part of testing for an hourly backup automated script. I added a line to pg_hba.conf for this and it looks like:

local     replication      postgres                      trust

But, this entry causes a FATAL error: no pg_hba.conf entry for replication connection from host "[local]", user "postgres", SSL off. What did I screw up? I'll be changing the user once I get this part working. The pg_basebackup command looks like:

pg_basebackup -D - -Ft -z -c fast -l hourly.backup > backup_file.gz

FYI, if I add "-h ", it does work as I do have another pg_hba.conf entry for:

host    replication   postgres       md5

Does local not work for replication entries?

(Using PostgreSQL 9.3)


The problem is: "localhost" can be UNIX sockets, IPv4 or IPv6. The first rule you passed is for UNIX sockets. Try to add a rule for IPv4 and one for IPv6. It should work then. Btw, a SIGHUP is enough in case you change pg_hba.conf.

  • Unix domain sockets are refered to with local and never localhost. Anyway the question never mentions localhost in the first place, so it's not obvious why it would even be involved here. – Daniel Vérité Oct 29 '14 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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