Re: deleting the master but not the detail - Mailing list pgsql-general

From Webb Sprague
Subject Re: deleting the master but not the detail
Date
Msg-id b11ea23c0807171150x79452acawe969a2bfe0c9bde8@mail.gmail.com
Whole thread Raw
In response to Re: deleting the master but not the detail  ("Ismael ...." <ismaelpsp@hotmail.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] postmaster.pid not visible
Next
From: salman
Date:
Subject: Re: TODO list and "hyphen"