Re: cascade delete

From: Bhushan Bhangale <bbhangale(at)Lastminute(dot)com>
To: pg(at)fastcrypt(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: cascade delete
Date: 2004-02-16 15:33:31
Message-ID: C9590F897BFAD7119E63000BCD682083C66E03@lmnukpriv.lastminute.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Well I did google and got that delete cascade DDL for postgres. I tried it
using odbc and jdbc but didn't worked.

-----Original Message-----
From: Dave Cramer [mailto:pg(at)fastcrypt(dot)com]
Sent: 16 February 2004 15:03
To: Bhushan Bhangale
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] cascade delete

Does this work in psql? The driver wouldn't do anything to interfere
with this.

Dave
On Mon, 2004-02-16 at 09:49, Bhushan Bhangale wrote:
> Hi,
>
> I have following 2 tables in postgres DB. I created a cascade delete
> constraint on image_id column of accomm_images which is a foreign key from
> image tbale.
>
> When I execute -> delete from accomm_images
> It should delete all the child records of image table as well. But its not
> happening.
>
> CREATE TABLE image(
> id int4 NOT NULL,
> url int4 NOT NULL
> );
>
> CREATE TABLE accomm_images(
> accomm_id int4 NOT NULL references accomm(id),
> image_id int4 NOT NULL references image(id) on delete
> cascade
> );
>
>
> Is there anything missing?
>
> Thanks
> Bhushan
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
--
Dave Cramer
519 939 0336
ICQ # 14675561

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2004-02-16 15:50:32 Re: cascade delete
Previous Message Dave Cramer 2004-02-16 15:03:04 Re: cascade delete