ON DELETE CASCADE doesn't work

Поиск
Список
Период
Сортировка
От Miia Leino
Тема ON DELETE CASCADE doesn't work
Дата
Msg-id 005c01c1e547$d2f07fe0$5600a8c0@salo.fi
обсуждение исходный текст
Ответы Re: ON DELETE CASCADE doesn't work  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
I'm having a problem with automatic deletion from the referencing table when a row is deletet from the parent table. This works sometimes and sometimes it doesn't, could someone have an idea why this is happening??
Thank you!!
I use the syntax

CREATE TABLE table1

(

            id int4 PRIMARY KEY

DEFAULT nextval(‘bulletin_id_sq’)

);

CREATE TABLE table2(

            id int4,

name text,

            CONSTRAINT table3_id_fk FOREIGN KEY(id)

            REFERENCES table1(id)

ON DELETE CASCADE

ON UPDATE CASCADE

  );

 

CREATE TABLE table3

(

            id int4,

            content text,

            CONSTRAINT table3_id_fk FOREIGN KEY(id)

            REFERENCES table1(id)

ON DELETE CASCADE

ON UPDATE CASCADE

);

AND always when the table is created it informes that the trigger has created

for example I created a table test it gave this notice:

 create table test(id int4, constraint test_lang_id_fk foreign key(id) references languages(language_id) on delete cascade on update cascade);
NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE

 

 

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

Предыдущее
От: Masaru Sugawara
Дата:
Сообщение: Fw: views
Следующее
От: "Nikolay Mihaylov"
Дата:
Сообщение: Backup very large databases