Question: how to setup database replication in postgresql?
Answer: Create a user for replication. To perform replication, Postgres requires a user, also called a role, with special permissions. ...  Create the archive directory. ...  Edit pg_hba. ...  Edit postgresql. ...  Restart the primary server. ...  Run the backup utility. ...  Edit postgresql. ...  Create the recovery configuration file.