delete cascade not working

Поиск
Список
Период
Сортировка
Искать
От
Kenneth Tilton
Тема
delete cascade not working
Дата
Msg-id
49F36C10.3070405@gmail.com
Список
Дерево обсуждения
delete cascade not working Kenneth Tilton <kentilton@gmail.com>
Re: delete cascade not working Joshua Tolley <eggyknap@gmail.com>
Re: delete cascade not working Kenneth Tilton <kentilton@gmail.com>
Re: delete cascade not working Joshua Tolley <eggyknap@gmail.com>
My noob understanding is that deleteing one of these:

CREATE TABLE provider_input.file_load
(
   sid serial NOT NULL,
   file_name_full text,
   file_name text,
   file_creation_date text,
   load_universal_time numeric,
   headers text,
   date timestamp without time zone DEFAULT now(),
   CONSTRAINT file_load_pkey PRIMARY KEY (sid)
)

Given constraint:

ALTER TABLE provider_input.common
   ADD CONSTRAINT common_pin_file_load_sid_fkey FOREIGN KEY 
(pin_file_load_sid)
       REFERENCES provider_input.file_load (sid) MATCH FULL
       ON UPDATE NO ACTION ON DELETE CASCADE;


Would cause any of these referring to the file_load to be deleted:

CREATE TABLE provider_input.common
(
   sid serial NOT NULL,
   pin_file_load_sid integer,
   load_row_no integer,
   CONSTRAINT common_pin_file_load_sid_fkey FOREIGN KEY (pin_file_load_sid)
       REFERENCES provider_input.file_load (sid) MATCH FULL
       ON UPDATE NO ACTION ON DELETE CASCADE
)

...but I just tried it and the file_load is gone but not the items that 
referenced it. Two things that might matter:

    I am using pgAdminIII to do the delete

I do not actually instantiate common, I have a table that inherits from 
that. I will play around now to see if that is an issue, thought I'd 
send up a flare here at the same time.

kt
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Merlin Moncure
Дата:
FAQ