Re: deleting the master but not the detail

Поиск
Список
Период
Сортировка
От Webb Sprague
Тема Re: deleting the master but not the detail
Дата
Msg-id b11ea23c0807171150x79452acawe969a2bfe0c9bde8@mail.gmail.com
обсуждение исходный текст
Ответ на Re: deleting the master but not the detail  ("Ismael ...." <ismaelpsp@hotmail.com>)
Список pgsql-general
>>>> hi
>>>> I have one of those master-detail relationships here and I need to be able
>>>> to delete the master but leave the details untouched

when you create the table with an FK constraint, use the ON DELETE SET
NULL option, or SET DEFAULT.  And read the docs on "CREATE TABLE":

http://www.postgresql.org/docs/8.3/static/sql-createtable.html

>>>
>>> Then remove the referential integrity constraint, since it's obviously
>>> incompatible with your business requirements.

Wrong.  See above.  Unless I misunderstand, then I apologize for the noise....

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] postmaster.pid not visible
Следующее
От: salman
Дата:
Сообщение: Re: TODO list and "hyphen"