Re: Need to update all entries of one table based on an earlier backup

From: "Gregory Williamson" <Gregory(dot)Williamson(at)digitalglobe(dot)com>
To: "Thomas Pundt" <thomas(dot)pundt(at)rp-online(dot)de>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need to update all entries of one table based on an earlier backup
Date: 2008-06-20 10:55:37
Message-ID: 8B319E5A30FF4A48BE7EEAAF609DB233021F2E71@COMAIL01.digitalglobe.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Pundt wrote:
>
> On Freitag, 20. Juni 2008, Gregory Williamson wrote:
<...snip...>
> Does
>
> update foo
> set foo.foo_name2 = foo_old.foo_name2
> from foo_old
> where foo.foo_id = foo_old.foo_id;
>
> work for you?

Thanks to all for pointing out the FROM clause.!

"UPDATE foo set foo_name2 = foo_old.foo_name2 FROM foo_old WHERE foo.foo_id = foo_old.foo_id;" did the trick.

For some reason I keep forgetting that bit. Especially when under stress in the wee hours of the morn. Back to sleep ... ZZZzzzzZZZZ

And thanks again !

GSW

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2008-06-20 11:34:59 test aggregate functions without a dummy table
Previous Message Thomas Pundt 2008-06-20 10:40:05 Re: Need to update all entries of one table based on an earlier backup