pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pgsql-sql <pgsql-sql@fc.emc.com.ph>
To: pgsql-sql@postgresql.org
Subject: Re(2): trigger output to a file
Date: Sat, 24 Mar 2001 07:22:32 +0800
Message-ID: <fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph> (raw)

Thanks Cedar, Jan, and Andy.

Actually the setup is something like this...
There are two remote servers-remoteA and remoteB.
The table of remoteA needs to be sychronized with the
table of remoteB all the time (well, there could be an interval).
remoteB will *publish* every changes and remoteA is *subscribe* to it.

These were my previous solutions:
1. Have a program (using PERL & DBI) in remoteA to connect to 
    remoteB and do the synchronization.
    >>>>>> I can't buy this 'coz remoteB has too many *hits*.
                I just can't afford the cost.
2. Have a trigger in remoteB that will output to a file the result of
every sql
    or the actually sql.
    >>>>>> My understanding now is that this will not do it because
                of a possible transaction rollback -- thanks again.

As much as possible I want to do the synchronization
*incrementally* (just deal with the difference between remoteA & remoteB).
But I guess I have to do it the hard way.

Here's my third solution. Please comment on this.
KNOWN FACTORS:
  ^ poor connection
       >>> the solution should be intelligent enough to handle such
situation.
3RD SOLUTION:
  ^ Have a script in remoteB to use pg_dump or sql copy and place it in
the 
     crontab. (say every 5 seconds)
  ^ Have a script in remoteA that will copy the dump.file from remoteB.
    Place it in the crontab and use *scp* (secure copy) for the copying.
    After dump.file is acquired, have another script to take care of it.

What do you think? Any better idea?
Thank you.

Sherwin    




Message-ID: <fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph>
Permalink:  ../fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph/
Also on:    postgresql.org/message-id/fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pgsql-sql@fc.emc.com.ph
  Subject: Re: trigger output to a file
  In-Reply-To: <fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph>
  References: <fc.000f567200a7a249000f567200a7a249.a7a286@fc.emc.com.ph>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox