[Bucardo-general] Workaround for lack of DDL triggers?

Greg Sabino Mullane greg at endpoint.com
Fri Mar 25 14:43:49 UTC 2011


On Thu, Mar 17, 2011 at 01:01:21AM -0700, Isaac Reuben wrote:
> Would be really great to have DDL changes go through replication, but it's
> not possible now due to Postgres not supporting triggers on DDL changes.
> But what about a workaround of creating a schema_migrations table to
> track requested DDL changes (either just with a text field with the DDL
> statement to execute, or a more application-specific description of the
> change to make) and then a trigger on that table to execute the change?
> So instead of directly creating a table or column with CREATE/ALTER, you
> would insert a row in the the "schema_migrations" table and let the
> trigger do the DDL work for you.  Then the same row should end up on the
> other side, and could activate the trigger to do the DDL changes there?
> Super hacky, and maybe not possible at all, but was curious if anyone had
> investigated that route.

Nobody has as far as I know, but the idea has merit. A few classes of changes 
will not work, of course, such as changing the name of a primary key on 
a replicated table, but the majority of things should work. Some will require 
stopping and starting Bucardo (e.g. adding a new column).

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20110325/9de6bbd6/attachment.bin 


More information about the Bucardo-general mailing list