Re: Command Triggers - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Command Triggers
Date
Msg-id 4EE80628.5020104@Yahoo.com
Whole thread Raw
In response to Re: Command Triggers  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Command Triggers
List pgsql-hackers
On 12/13/2011 9:59 AM, Robert Haas wrote:
> it.  Dimitri says that he wants it so that we can add support for
> CREATE TABLE, ALTER TABLE, and DROP TABLE to Slony, Bucardo, and
> Londiste.  My fear is that it won't turn out to be adequate to that
> task, because there won't actually be enough information in the CREATE
> TABLE statement to do the same thing on all servers.  In particular,
> you won't have the index or constraint names, and you might not have
> the schema or tablespace information either.  But maybe we ought to
> put the question to the intended audience for the feature - is there a
> Slony developer in the house?

I agree. While it is one of the most "asked for" features among the 
trigger based replication systems, I fear that an incomplete solution 
will cause more problems than it solves. It is far easier to tell people 
"DDL doesn't propagate automatically, do this instead ..." than to try 
to support a limited list of commands, that may or may not propagate as 
intended. And all sorts of side effects, like search_path, user names 
and even the existing schema in the replica can cause any given DDL 
"string" to actually do something completely different than what 
happened on the origin.

On top of that, the PostgreSQL main project has a built in replication 
solution that doesn't need any of this. There is no need for anyone, but 
us trigger replication folks, to keep command triggers in sync with all 
other features.

I don't think it is going to be reliable enough any time soon to make 
this the default for any of the trigger based replication systems.


Jan

-- 
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: WIP: URI connection string support for libpq
Next
From: Robert Haas
Date:
Subject: Re: NOTIFY with tuples