Re: replication

Поиск
Список
Период
Сортировка
От Elmar Haneke
Тема Re: replication
Дата
Msg-id 39CB1120.DBEC91AB@haneke.de
обсуждение исходный текст
Ответ на replication  ("Adam Lang" <aalang@rutgersinsurance.com>)
Ответы Re: replication
Список pgsql-general

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Vadim Govorov
Дата:
Сообщение: Trouble with WIN charset
Следующее
От: Mathieu Arnold
Дата:
Сообщение: data replication