Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6107037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:08:43+00:00 2026-05-23T14:08:43+00:00

I need to replicate a PostgreSQL database server as follows: Two servers are adjacent

  • 0

I need to replicate a PostgreSQL database server as follows:

  1. Two servers are adjacent to each-other – one is the master and the other standby. If the master fails, the standby takes over. Replication from master to slave needs to be failsafe, hence, synchronous. The standby will not be used for any querying unless it has become a master. So, no high-availability/load-balancing is required.

  2. There is another backup server at a remote location. Data from the master server mentioned above will be replicated to this remote server asynchronously and in batches. Time is not a factor at all in this replication – a couple of hours is just fine. This server would be used just for backup.

I’ve studied the currently available replication solutions from the PostgreSQL docs as well as from Google, but can’t decide which combination of synchronous-asynchronous solutions would I need.

The closest I came up with is using pgpool-II for scenario 1 and Mammoth for scenario 2. However, as pgpool is statement-based, what would happen to queries containing rand() and now()?

Please note that I’d rather use free and open-source replication tools.

Also, just a side question – according to scenario 1 above, when the master fails, the standby will take over. Would the master-slave role be reversed after that, or would after the recovery of the master server the slave would go back to its standby state?

Any suggestion would be highly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:08:43+00:00Added an answer on May 23, 2026 at 2:08 pm

    You didn’t mention if the server in question was on a specific version or if this was a new project with the freedom to choose the version. The answers vary based on that information.

    If you are starting with a clean slate, I would recommend designing based on the PostgreSQL 9.1 beta. The final version will be released long before you would be ready to go into a production environment and it has binary synchronous replication built-in.

    I’ve been using the built-in asynchronous replication in PostgreSQL for years in almost the exact same scenario you describe and it has always been rock-solid for me. It’s become even better with 9.0 with Hot standby and it’s become much easier to configure and maintain. 9.1 provides the only missing piece you require.

    However, if you are trying to replicate an existing server, built-in asynchronous replication with aggressive settings for “checkpoint_timeout” a very frequent backup of unarchived WAL files could be sufficient until you can upgrade to 9.1.

    The bottom line here is that you can get exactly what you want is with stock PostgreSQL 9.1–no third-party products required.

    As for failover, it is not an automatic process, you’ll need to handle that yourself. I would recommend that after a failover, switching the roles of the two machines until either the next failover event or until a controlled manual failover during a scheduled outage during a slow period of use. Again, this is not automatic and much be managed by the administrator (via shell scripts, presumably).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to replicate data from Microsoft SQL Server to MySQL or PostgreSQL. The
So my Android app uses a SQLite database. I need to replicate two or
I need to replicate, in a new database, the result of a view. Is
I have a rails application running over Postgres. I have two servers: one for
I have a half dozen views in SQL Server that I need to replicate
I need to replicate a sequence/counter across an eight node cluster. This means that
I need to replicate a T-SQL statement that has an inner select, using LINQ:
User enters pairs of values. I need to replicate the last set and renumber
I need to replicate the following working HQL query using criteria API. session.CreateQuery( select
I need to replicate the layout-weight parameter that you can set in XML within

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.