Re: Delete across 5 Joined tables
| От | Raymond O'Donnell |
|---|---|
| Тема | Re: Delete across 5 Joined tables |
| Дата | |
| Msg-id | 48A88DBD.2070701@iol.ie обсуждение исходный текст |
| Ответ на | Delete across 5 Joined tables (Fuzzygoth <dav.phillips@ntlworld.com>) |
| Список | pgsql-general |
On 15/08/2008 11:08, Fuzzygoth wrote: > but I need to be able to delete from up to 5 different tables, is > there a quick and > simple way of doing this? can someone post an example? Just guessing without more detailed information, but are the tables related one-to-many using foreign keys? If so, when defining the foreign key you can set the delete to cascade whenever a "master" row is deleted: alter table foo add constraint foo_fk foreign key [...] on delete cascade; ...or something like that. Ray. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------
В списке pgsql-general по дате отправления: