Re: replicating DDL statements - Mailing list pgsql-general

From Gregory Wood
Subject Re: replicating DDL statements
Date
Msg-id 04c501c2e40d$d09f16f0$4f89ffcc@eng3
Whole thread Raw
In response to replicating DDL statements  ("Ed L." <pgsql@bluepolka.net>)
Responses Re: replicating DDL statements  ("Ed L." <pgsql@bluepolka.net>)
List pgsql-general
> I considered setting up triggers on Pgsql system tables to replicate DDL
> statements and replicate those system row changes much like user data, and
> to also use system table triggers to create replication triggers for newly
> added tables.  But user triggers are not allowed on system tables, and I'm
> not sure it'd be reasonable or wise anyway.  Comments or other ideas?

One potential problem you might run into is triggers on said added tables.

I had to disable my user-made triggers on slave databases because those
triggers would add rows to secondary audit tables, which were also covered
by replication. In other words, I would have had duplicate entries in my
audit tables... one for the master being replicated, one for the slave as
the trigger executed.

Additionally, I have functions that set timestamps to reflect the last
updated time of a row. If I kept the triggers on the mirrored database, the
timestamps will differ from the slave to the master (and possibly even the
other slaves).

I imagine things could get hairy pretty fast.

Greg


pgsql-general by date:

Previous
From: Garo Hussenjian
Date:
Subject: Re: Postgres and gdb: p debug_query_string RE: Query
Next
From: Patrick Macdonald
Date:
Subject: Re: 7.4?