Re: Need to update all entries of one table based on an earlier backup - Mailing list pgsql-general

From Gregory Williamson
Subject Re: Need to update all entries of one table based on an earlier backup
Date
Msg-id 8B319E5A30FF4A48BE7EEAAF609DB233021F2E71@COMAIL01.digitalglobe.com
Whole thread Raw
In response to Need to update all entries of one table based on an earlier backup  ("Gregory Williamson" <Gregory.Williamson@digitalglobe.com>)
List 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

pgsql-general by date:

Previous
From: "Markus Wollny"
Date:
Subject: Re: Need to update all entries of one table based on an earlier backup
Next
From: Thomas Pundt
Date:
Subject: Re: Need to update all entries of one table based on an earlier backup