Re: replicating DDL statements

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: replicating DDL statements
Date: 2003-03-06 18:25:49
Message-ID: 04c501c2e40d$d09f16f0$4f89ffcc@eng3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2003-03-06 18:33:09 Re: replicating DDL statements
Previous Message Patrick Macdonald 2003-03-06 18:21:07 Re: 7.4?