Re: Can i force deletion of dependent rows?
От
Rob Sargent
Тема
Re: Can i force deletion of dependent rows?
Дата
Msg-id
4B799ABE.9040701@gmail.com
Ответ на
Re: Can i force deletion of dependent rows? (Tim Landscheidt)
Список
Дерево обсуждения
Re: Can i force deletion of dependent rows? Tim Landscheidt <tim@tim-landscheidt.de>
Re: Can i force deletion of dependent rows? Rob Sargent <robjsargent@gmail.com>
Re: Can i force deletion of dependent rows? "Wayne E. Seguin" <wayneeseguin@gmail.com>
Re: Can i force deletion of dependent rows? Shoaib Mir <shoaibmir@gmail.com>
Re: Can i force deletion of dependent rows? Shruthi A <shruthi.iisc@gmail.com>
then I think OP needs to delete A where "your x"; On 02/13/2010 12:05 AM, Tim Landscheidt wrote: > Shruthi A wrote: > >> I have 2 tables (A and B) where the table B has a foreign key reference to >> table A. Like this: > >> create table A (x int primary key); >> create table B (y int primary key, z int references A (x) ); > >> As you can see, i've not specified any further 'on delete' clause to the >> foreign key constraint like 'on delete cascade' or 'on delete restrict' or >> 'on delete set null' or 'on delete set default'. This means that the >> default behavior is followed ie 'on delete restrict' holds by default. > >> Now I want to delete a particular row from table A. Is there any way I can >> force deletion of all the dependent rows in table B? > >> Note that the tables have already been created in the above manner and >> populated. I want to do this deletion through DML only ie without any >> change in the table definition. > > "DELETE FROM B WHERE z = 'your x';"? > > Tim > >
В списке pgsql-sql по дате отправления