Trigger to clone across databases?

Started by Darren Govoniabout 17 years ago4 messagesgeneral
Jump to latest
#1Darren Govoni
darren@ontrenet.com

Hi,
I'm looking for a trigger (any language) that can clone the inserted
row and insert it in another postgres server elsewhere. Is this
possible? Practical? Thoughts?

I know there are some replication systems out there, but I'm hoping a
simple trigger will suffice since I only need to clone one row at a time
on insert.

Cheers,
Darren

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Darren Govoni (#1)
Re: Trigger to clone across databases?

On Fri, Jan 16, 2009 at 6:31 PM, Darren Govoni <darren@ontrenet.com> wrote:

Hi,
I'm looking for a trigger (any language) that can clone the inserted
row and insert it in another postgres server elsewhere. Is this
possible? Practical? Thoughts?

I know there are some replication systems out there, but I'm hoping a
simple trigger will suffice since I only need to clone one row at a time
on insert.

Slony does essentially that. A trigger puts the updates into a log
table, the slony process gathers all the changes up and puts them into
the destination tables.

#3Jasen Betts
jasen@xnet.co.nz
In reply to: Darren Govoni (#1)
Re: Trigger to clone across databases?

On 2009-01-17, Darren Govoni <darren@ontrenet.com> wrote:

Hi,
I'm looking for a trigger (any language) that can clone the inserted
row and insert it in another postgres server elsewhere. Is this
possible? Practical? Thoughts?

I know there are some replication systems out there, but I'm hoping a
simple trigger will suffice since I only need to clone one row at a time
on insert.

that can probably be done (using C for instance) , but do you really want the
penalty of every insert waiting for a connection to be established to the
remote server?

some other systems use the trigger to insert the nes column into holding a table
and trigger a notify,

then a separate application waiting for the notify retreives the row
and inserts it onto the remote server.

#4Grzegorz Jaśkiewicz
gryzman@gmail.com
In reply to: Jasen Betts (#3)
Re: Trigger to clone across databases?

this not only can be done , but is done - for instance slony does (also) that.