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

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Khangelani Gama <kgama(at)argility(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
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: 2014-03-28 11:23:13
Message-ID: CAF-3MvNmmKTn7+nho3qUvGzhB7xNdUV6jb5mZQFYBoBq4fAN=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28 March 2014 11:07, Khangelani Gama <kgama(at)argility(dot)com> wrote:
> Hi Chris or anyone who can help
>
> When I try this just below, it complains about foo (new table created in
> db2) , 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;

Really? I would have expected ERROR: table or schema bar does not exist.

Look up the syntax for UPDATE FROM.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Curvey 2014-03-28 11:50:29 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
Previous Message lst_hoe02 2014-03-28 10:35:22 Re: [GENERAL] openvz and shared memory trouble