I am getting this error:
pg_basebackup: error: backup failed: ERROR:
could not open file "./.pg_hba.conf.swp": Permission denied
Could you please shed some light on possible reasons?
2
The problem is that you created a file in the data directory that the PostgreSQL user cannot read.
I guess you used to root
user to edit pg_hba.conf
with the vi
editor, and the session got killed, so that a swap file stayed behind.
Remove the file, and don’t use the root
user for tasks that a normal user can do.