Re: replicating DROP commands across servers - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: replicating DROP commands across servers
Date
Msg-id 20140613195049.GQ18688@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: replicating DROP commands across servers  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: replicating DROP commands across servers  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Re: replicating DROP commands across servers  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Here's a patch implementing the proposed idea.  This is used in the
Bidirectional Replication stuff by Simon/Andres; it works well.


One thing of note is that I added output flags for "normal" and
"original", which mostly come from performDeletion flags.  This let one
select only such objects when trying to replicate a drop; otherwise,
we'd add RI triggers to the set to drop remotely, which doesn't work
because their names have OIDs embedded, and in the remote system those
are different.

One curious thing is that I had to add a hack that if an object has a
"reverse" flag in the ObjectAddresses array, also set the "normal"
output flag.  (Another possibility would have been to add a "reverse"
output flag, but there doesn't seem to be a use for that --- it seems to
expose internals unnecessarily.)

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLESPACE MOVE command tag tweak
Next
From: Alvaro Herrera
Date:
Subject: Re: Add CREATE support to event triggers