Re: [BUGS] Where clause in pg_dump: need help - Mailing list pgsql-general

From Francisco Olarte
Subject Re: [BUGS] Where clause in pg_dump: need help
Date
Msg-id CA+bJJby_GFH-6vm6Mh6CjQ_v98YuAH0S+W-xPWc2ZzQhodYRMg@mail.gmail.com
Whole thread Raw
Responses Re: [BUGS] Where clause in pg_dump: need help
Re: [BUGS] Where clause in pg_dump: need help
List pgsql-general
1.- CCing to the list ( remember to hit reply-all or whatever your MUA
uses for that, otherwise threads may get lost ).

2.- Try to avoid top-posting, it's not the style of the list ( or mine ).

On Fri, Jul 8, 2016 at 4:43 AM, Prashanth Adiyodi
<Prashantha@celltick.com> wrote:
> Basically my requirement is, I have a live Db with certain tables and a backup Db at another location (both on
postgressql).I need to take a backup of this live DB every night for the previous day (i.e the backup script running on
07/07/2016will take the backup of the DB for 06/07/2016). This backup will be then transferred to the backup DB server
andwill be inserted into that DB. From what I have read pg_dump is the solution (similar to export in oracle), do you
thinkof any other approach to get to this objective, have you come across a script or something that already does this, 

Your requirement is a bit 'understated'. I assume your problem is:

1.- You have a backup with a series of tables which get inserted WITH
a timestamp.
2.- At the end of the day you want to transfer the inserted data, and
only the inserted data, to another server and insert it ther.

If BOTH servers are postgres, you can do it easily with a series of
COPY commands easily. If the target one is not postgres I would use it
too, but pass the COPY data through a perl script to generate whatever
syntax the target DB needs ( I've done that to go from postgres to sql
server and back using freebcp, IIRC, on the sql server side )

You still can have problems IF you have updates to the tables, or
deletions, or <insert your favorite problematic operation here>. But
if you just have insertions, copy is easy to do.

Francisco Olarte.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pasting a lot of commands to psql
Next
From: Sameer Kumar
Date:
Subject: Re: [BUGS] Where clause in pg_dump: need help