Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Freitag, 20. Juni 2008, Gregory Williamson wrote:
| For reasons best left unmentioned, I need to update entries in a table from
| a backup; I need to do all entries.
|
| For reasons eluding my sleep deprived eyes this fails in every variation I
| can think of:
|
| update foo set foo.foo_name2=foo_old.foo_name2 where foo.foo_id =
| foo_old.foo_id; ERROR:  missing FROM-clause entry for table "foo_old"

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?

| Could someone please hit me with a clue-stick ? This is crucial and yet I
| am stumbling over something. Since I am not updating foo_old I am baffled
| as to what this messsage really means. I've tried "where foo_old.foo_id =
| foo.foo_id ... same message.

Ciao,
Thomas

-- 
Thomas Pundt <thomas.pundt@xxxxxxxxxxxx> ---- http://rp-online.de/ ----


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux