cascade delete

Поиск
Список
Период
Сортировка
От Bhushan Bhangale
Тема cascade delete
Дата
Msg-id C9590F897BFAD7119E63000BCD682083C66DFB@lmnukpriv.lastminute.com
обсуждение исходный текст
Ответы Re: cascade delete
Re: cascade delete
Список pgsql-jdbc
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
________________________________________________________________________

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Warren Little
Дата:
Сообщение: Re: idle in transaction
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: cascade delete