pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Elmar Haneke <elmar@haneke.de>
To: Adam Lang <aalang@rutgersinsurance.com>
To: PGSQL General <pgsql-general@postgresql.org>
Subject: Re: replication
Date: Fri, 22 Sep 2000 09:58:24 +0200
Message-ID: <39CB1120.DBEC91AB@haneke.de> (raw)
References: <001d01c023ca$e37d9cc0$330a0a0a@Adam>
Adam Lang wrote:
>
> Are there any type of replication features in postgresql 7.0?
>
> I would like it where two databases have the same structure, but say at
> midnight every night Database 1 synchs up database 2.
>
> Granted, I could always write code to do that, but it wouldn't be very
> sophisticated. (If I coded it, would do something like find rows in table
> 1 which aren't in the second database, append them database two, same with
> the second table, etc.)
I would suggest to consider the xmin values stored with each row in
database. This number does contain the transaction-number of the
last change to this tuple.
An replication should copy all tuples having larger xmin than
copied by the last replication. If each table has an primary key,
replication can decide wether the tuple is updated or inserted.
For deletes you should consider to use triggers copying the keys
of deleted tuples to an "delete-log-table". If an delete-transaction
is aborted, the entries to this table should be cancelled
automatically by the transaction control.
I'm not sure wether you can use the oid as an key for this purpose.
Is oid updatable to keep it in sync on both databases?
Elmar
view thread (131+ messages) latest in thread
Message-ID: <39CB1120.DBEC91AB@haneke.de> Permalink: ../39CB1120.DBEC91AB@haneke.de/ Also on: postgresql.org/message-id/39CB1120.DBEC91AB@haneke.de ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-general@postgresql.org Cc: elmar@haneke.de, aalang@rutgersinsurance.com Subject: Re: replication In-Reply-To: <39CB1120.DBEC91AB@haneke.de> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox