I have the following case:
- the master database has an additional tablespace
- I'm trying to replicate the master with the
pg_basebackup
tool - the directory / partition layout on the slave is the same as on the master
What parameters should I use to set up replication safely? Do I need to map tablespace with -T parameter or is it only required if I am doing pg_basebackup
on the master? pg_basebackup
is generaly safe? Data not be deleted from the master?
My command is:
db_slave# pg_basebackup -h db_master -p 5433 -U replication -D /var/lib/postgresql/12/main -P -Xs -Fp -R
But I get:
pg_basebackup: error: directory "/home/db" exists but is not empty
pg_basebackup: removing data directory "/var/lib/postgresql/12/main"
Tablespace is store in /home/db. Thanks a lot for all answers.