Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

postgresql 9.0 streaming replication + hot standby is running. Now i need to add one more database to current cluster. What is the best way of doing this? I have a backup file about 20GB. should i restore to that cluster? can standby server have all the data?

share|improve this question
up vote 1 down vote accepted

Yes, you can restore the backupfile to your hot-standby. But there are some detail you should notice. The following are steps I suggest

  1. create your database user on primary node
  2. create tablespace directory both on the primary node and standby node. (If you don't create the same directory on standby node, then after you create a database on primary node, standby PostgreSQL server will down. So, take care!)
  3. create tablespace on primary node
  4. create database on primary node. If a same name was automatlly created on the standby node then all is okey.
  5. restore the backup file to your primary database. then the standby database will replicate the data from the primary db.

those steps will have an impact on performace, so take care.

share|improve this answer

Hz.Root, your question has many open ends but I will try to answer.

What is the best way of doing this?

Just create a new database in master server and populate it.

I have a backup file about 20GB. should i restore to that cluster?

Yes. To be precise, you restore it to the database, not to the cluster.

can standby server have all the data?

Standby server MUST have all the data - that is it's purpose. Every database, and every other object that is in primary PostgreSQL cluster, will be replicated to secondary server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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