Skip site navigation (1) Skip section navigation (2)

Re: Real time replication of PG DBs accross two servers -

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Paul Breen <pbreen(at)computerpark(dot)co(dot)uk>
Cc: Bradley Kieser <brad(at)kieser(dot)net>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Real time replication of PG DBs accross two servers -
Date: 2004-04-14 14:57:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On Wed, Apr 14, 2004 at 14:44:57 +0100,
  Paul Breen <pbreen(at)computerpark(dot)co(dot)uk> wrote:
> The way we approached it was to do the replication ourselves at the
> application level.  This isn't as hard as it sounds: you just open 2 db
> connections (1 to the master, 1 to the slave), start transactions on both
> connections, then write your data.  If an error occurs on either
> connection, you rollback on both connections.  This means you can still
> have writes that fail (for whatever reason) but both dbs are _consistent_.

This is guarenteed to work in general. When there are concurrent transactions,
one transaction may succeed on commit and the other fail. If you are using
sequences you could also end up with different values in each database.
That may or may not be a problem depending on how you use them.

In response to


pgsql-admin by date

Next:From: Jodi KanterDate: 2004-04-14 15:18:24
Subject: XTG Data Modeller
Previous:From: Joe MaldonadoDate: 2004-04-14 14:54:22
Subject: Performance tuning for copy in

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group