| От | Bruno Wolff III |
|---|---|
| Тема | Re: Removing Rows in Foreign Keys |
| Дата | |
| Msg-id | 20050404140809.GA4948@wolff.to обсуждение исходный текст |
| Ответ на | Removing Rows in Foreign Keys (brew@theMode.com) |
| Список | pgsql-novice |
On Mon, Apr 04, 2005 at 02:56:56 -0400, brew@theMode.com wrote: > > Well, I confess. Although I've several databases running on postgreSQL > I've never done more than just store data. (no constaints, no triggers, no > functions, not even any transactions) I'm setting up a new schema for a > new database and am learning about using foreign keys. > > Is there a SQL command that removes both a row in a table and the rows in > other tables that reference it or do I have to do it manually? > > Sort of like 'DELETE CASCADE....." which I tried, to no avail. Perusing > the manual didn't reveal anything.... If you use foreign keys that are set to on DELETE CASCADE then deleting a referenced row will also delete all of the rows that reference it.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера