Обсуждение: Feature request: Replicate only parts of a database

Поиск
Список
Период
Сортировка

Feature request: Replicate only parts of a database

От
A B
Дата:
Hi there!
I have a small problem, in a database I need to export parts of a
database table to another server, and I could easily accomplish  ( I
hope)  that by creating a view and select * from the view and send it
over to the other server or use triggers to record what rows are
inserted and deleted. (I have not written that part yet)

With the new very nice streaming replication, I think it would be much
better if the database could send the data directly to the other
server instead of having to write my own sync-script.
But I don't want to sync the entire database since only a very small
fraction of the data should be replicated.

How about putting that on the feature request list? :-)

Re: Feature request: Replicate only parts of a database

От
Peter Geoghegan
Дата:
On 27 May 2011 05:53, A B <gentosaker@gmail.com> wrote:

> I have a small problem, in a database I need to export parts of a
> database table to another server, and I could easily accomplish  ( I
> hope)  that by creating a view and select * from the view and send it
> over to the other server or use triggers to record what rows are
> inserted and deleted. (I have not written that part yet)
>
> With the new very nice streaming replication, I think it would be much
> better if the database could send the data directly to the other
> server instead of having to write my own sync-script.
> But I don't want to sync the entire database since only a very small
> fraction of the data should be replicated.

That isn't going to happen, because of the way streaming replication
is implemented. Besides, you haven't even described what interface
such a feature would actually have. How would it know which tuples to
replicate? Is that really a more sensible interface than just being
able to selectively replicate a subset of tables?

Consider a trigger-based replication system like Slony or Londiste,
which allow asynchronous replication at table granularity.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Re: Feature request: Replicate only parts of a database

От
Andrew Sullivan
Дата:
On Fri, May 27, 2011 at 06:53:17AM +0200, A B wrote:

> hope)  that by creating a view and select * from the view and send it
> over to the other server or use triggers to record what rows are
> inserted and deleted. (I have not written that part yet)

You could do this today with Slony or Londiste or any of the other
trigger-based replication systems.

A
--
Andrew Sullivan
ajs@crankycanuck.ca