pg_basebackup: error: directory “dir_abc” exists but is not empty OR ERROR: tablespace “ABC” is not empty

This error is a very common error if any DBA is trying to take pg_basebackup in the same server where your PostgreSQL Instance is running. You must have created one directory where your user tablespace(apart from pg_default and pg_global tablespace) is lying. We should never create user tablespace directory within “data” directory. If we try … Continue reading pg_basebackup: error: directory “dir_abc” exists but is not empty OR ERROR: tablespace “ABC” is not empty