Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements - Mailing list pgsql-general

From Khangelani Gama
Subject Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements
Date
Msg-id cddea8cf293a1977d273d710c0cb1a68@mail.gmail.com
Whole thread Raw
In response to Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements  (Chris Curvey <chris@chriscurvey.com>)
Responses Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements  (Rémi Cura <remi.cura@gmail.com>)
Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements  (Chris Curvey <chris@chriscurvey.com>)
List pgsql-general

Hi Chris

 

I did replace foo and bar tables with my tables, in db2 I have table foo(the one to be updated) and the table bar(the one which has data I got from db1)

 

From: ccurvey@gmail.com [mailto:ccurvey@gmail.com] On Behalf Of Chris Curvey
Sent: Friday, March 28, 2014 1:50 PM
To: Khangelani Gama
Cc: pgsql
Subject: Re: [GENERAL] Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements

 

 

 

On Fri, Mar 28, 2014 at 5:56 AM, Khangelani Gama <kgama@argility.com> wrote:

Hi Chris or anyone who can help

 

When I try this just below, it complains about foo , saying “ERROR: schema “foo” does not exist.” I got stuck on this error for a while now but still trying to see why but still no luck so far. If you have something please help

 

 

begin;

 

update foo

set br_desc = bar.br_desc

, br_active = bar.br_active

(rest of columns)

where foo.br_cde = bar.br_cde;

 

 

you need to replace "foo" and "bar" with the names of your tables.


CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.

pgsql-general by date:

Previous
From: Chris Curvey
Date:
Subject: Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements
Next
From: Rémi Cura
Date:
Subject: Re: Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements