Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 70B12632B8E for ; Sat, 13 Feb 2010 02:11:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 03697-06 for ; Sat, 13 Feb 2010 06:11:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f186.google.com (mail-iw0-f186.google.com [209.85.223.186]) by mail.postgresql.org (Postfix) with ESMTP id E9B6D632AEA for ; Sat, 13 Feb 2010 02:11:15 -0400 (AST) Received: by iwn16 with SMTP id 16so3901454iwn.10 for ; Fri, 12 Feb 2010 22:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=aIHLzKQyLVB2MCgYqzi17bIHd7stAIfYAR2ARSgljWA=; b=PBm9jvQDMWr9xfNEoNOTBEBdW/znBA4MXGDqvE0Au6cGHp9+bdhTPzzfOnKKBVHKaA U/slTNZDrGBgf3CVR25d/mjDmfa89D/umyO2qwfDsG8Zg0jP51Q0l14HE8PVcT2avzBi w/1gkfNTuUoxYrqyugUpjCF1lnSP17VoZjk4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pSvVIb5FhbmmBgCoCM5kH01an5x/4kB3lAYUyi9AxsD0vwMFvfX/AUQhsEfjXXTyVU +u2TIejQnPjsYodMpTsi+yx6I2QiHooG2xPijANWzKWTkXSmSPv0Z0bw11CTa/wds9in VB714Wc+RWH2e8R6WhSYuzTGpjecSRDu4cozU= MIME-Version: 1.0 Received: by 10.231.191.135 with SMTP id dm7mr3923388ibb.46.1266041474889; Fri, 12 Feb 2010 22:11:14 -0800 (PST) In-Reply-To: <6caee9521002120424l27ec8d3eq3b69522d0a773686@mail.gmail.com> References: <6caee9521002120424l27ec8d3eq3b69522d0a773686@mail.gmail.com> Date: Sat, 13 Feb 2010 11:41:14 +0530 Message-ID: <6caee9521002122211q7e4fd2fcj1a0489fd64dc204a@mail.gmail.com> Subject: Can i force deletion of dependent rows? From: Shruthi A To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=0016367b6f6a61b6f2047f7540ab X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/50 X-Sequence-Number: 33649 --0016367b6f6a61b6f2047f7540ab Content-Type: text/plain; charset=ISO-8859-1 Hello, 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. Thanks, Shruthi --0016367b6f6a61b6f2047f7540ab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I have 2 tables (A and B) wher= e the table B has a foreign key reference to table A.=A0=A0 Like this:
<= br>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' clau= se to the foreign key constraint like 'on delete cascade' or 'o= n delete restrict' or 'on delete set null' or 'on delete se= t default'.=A0=A0 This means that the default behavior is followed ie &= #39;on delete restrict' holds by default.

Now I want to delete a particular row from table A.=A0 Is there any way= I can force deletion of all the dependent rows in table B?=A0

Note= that the tables have already been created in the above manner and populate= d.=A0 I want to do this deletion through DML only ie without any change in = the table definition.

Thanks,
Shruthi

--0016367b6f6a61b6f2047f7540ab--