I have a base table User (id serial primary key, name text);
and a lot of tables like this
Foo (id integer references User on update cascade on delete cascade, ....);
Assume I have
id =1 name= aaa
id =2 name= bbb
in the user table
and now I wish to remove the user with id=2, but I also want to
update all the Foo tables and set the id to 1 (the other user takes
over all the items), but I do not want to do this by calling update
for each table separatly.
The "on update cascade" sounds like what I need, in some way, but I'm
not sure how to really use it in this case.
Is it possible? If yes, how?
pgsql-novice by date
|Next:||From: Steve T||Date: 2008-10-03 09:59:00|
|Subject: Re: Forcing order of Joins etc|
|Previous:||From: Steve T||Date: 2008-10-03 09:01:45|
|Subject: Forcing order of Joins etc|