Search Postgresql Archives

Re: Delete across 5 Joined tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux