Re: [PROPOSAL] ON DELETE SET NULL () for Foreign Key Constraints - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PROPOSAL] ON DELETE SET NULL () for Foreign Key Constraints
Date
Msg-id 25367.1547946730@sss.pgh.pa.us
Whole thread Raw
In response to [PROPOSAL] ON DELETE SET NULL () for Foreign Key Constraints  (Paul Martinez <hellopfm@gmail.com>)
Responses Re: [PROPOSAL] ON DELETE SET NULL () for Foreign Key Constraints  (Paul Martinez <hellopfm@gmail.com>)
List pgsql-hackers
Paul Martinez <hellopfm@gmail.com> writes:
> I have a proposal for a feature to add to Postgres. I believe it is a natural
> extension to the current standard SQL ON DELETE SET NULL behavior when using
> composite foreign keys. The basic idea is that you can specify which columns to
> set to NULL in the DELETE trigger created by a foreign key constraint.

This seems like kind of a kluge, because it can only work in MATCH SIMPLE
mode, not MATCH FULL or MATCH PARTIAL.  (We don't have MATCH PARTIAL atm,
but it's in the spec so I imagine somebody will get around to implementing
it someday.  Anyway MATCH FULL is there now.)  In the latter two modes,
setting a subset of the referencing columns to null isn't sufficient to
make the row pass the constraint.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: pg_stat_statements vs. SELECT FOR UPDATE
Next
From: Andrew Gierth
Date:
Subject: Re: Ryu floating point output patch