| От | A B |
|---|---|
| Тема | CASCADING update |
| Дата | |
| Msg-id | dbbf25900810030247l450e1ae7uc40276e1fda63402@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: CASCADING update
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера