Re: deleting the master but not the detail

Поиск
Список
Период
Сортировка
От Ismael ....
Тема Re: deleting the master but not the detail
Дата
Msg-id BLU103-W21AF47FF3F24BD23FD670DA38E0@phx.gbl
обсуждение исходный текст
Ответ на Re: deleting the master but not the detail  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general

>
>> So is there no other way to do it but to verify the integrity using triggers
>> and drop the referential constraints?
>
> Well, you could do something using a before delete trigger on the
> referencing table that returns NULL to avoid the delete as well, but
> making it only prevent the deletions caused by the referential constraints
> might be difficult.
>

That's right, It's easier to verify the existence of the master before inserting
something in the details than controlling the way something gets deleted.
After all, is only a
PERFORM * FROM.... WHERE NEW.....
IF NOT FOUND THEN
RISE EXCEPTION 'that doesn't exists';...
_________________________________________________________________
Plug&Play te trae en exclusiva los mejores conciertos de la red
http://club.prodigymsn.com/

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

Предыдущее
От: "Douglas McNaught"
Дата:
Сообщение: Re: [HACKERS] postmaster.pid not visible
Следующее
От: "Ismael ...."
Дата:
Сообщение: Re: in query variables....