Search Postgresql Archives

Re: deleting the master but not the detail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>> 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....


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux