CASCADING update

Поиск
Список
Период
Сортировка
От A B
Тема CASCADING update
Дата
Msg-id dbbf25900810030247l450e1ae7uc40276e1fda63402@mail.gmail.com
обсуждение исходный текст
Ответы Re: CASCADING update  ("Obe, Regina" <robe.dnd@cityofboston.gov>)
Список pgsql-novice
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 по дате отправления:

Предыдущее
От: Steve T
Дата:
Сообщение: Forcing order of Joins etc
Следующее
От: Steve T
Дата:
Сообщение: Re: Forcing order of Joins etc