Database replication under Postgres

From: Paul Breen <paulb(at)computerpark(dot)co(dot)uk>
To: pgsql-admin(at)postgresql(dot)org
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Database replication under Postgres
Date: 1999-12-16 16:31:08
Message-ID: Pine.LNX.3.96.991216162724.12454A-100000@cpark37.computerpark.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hello all, I wonder if anyone could help me.

I'm currently working on a project where it is essential that we have some
kind of replication of our production database. I've found a number of
'near' solutions (e.g., doing a piped 'COPY IN/OUT' using psql - one
local and one remote - from a simple shell script) but this doesn't
'synchronise' the data, it just piles ALL the data from one database into
the other.

I've also looked into setting up rules on a table to NOTIFY me of an
insert|update|delete and then have a program that queries the difference
between the two databases and synchronises them accordingly. This is ok to
a point but is not particularly elegant or efficient. Basically I was
wondering if anyone knows of a better way of doing it or if someone has
written a tool for automating replication with Postgres.

If we were replicating data from one table to another in the SAME DATABASE
it would be easy to set up a rule such as:

CREATE RULE itbl1 AS ON INSERT TO tbl1 DO (INSERT INTO tbl2
values(new.i));

Ideally, I suppose what I am after - and I dare say I'm hoping to much -
is a simple solution that says the same as the above rule but where
"tbl2" is a table in a remote host's database.

I would be really grateful to hear from other users' experiences with any
form of replication/synchronisation under Postgres.

Thanks in advance.

Paul M. Breen
Computer Park Ltd
Email: pbreen(at)computerpark(dot)co(dot)uk

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Sam Hokin 1999-12-16 19:35:15 JDBC: can't connect in NT 4.0 SP 6 (JRE 1.2.2) as non-Administrator
Previous Message Christophe M 1999-12-16 15:41:31 Compatibility postgresql6.5.3 and psqlodbc drivers