Thread: FK on update no action patch

FK on update no action patch

From
Stephan Szabo
Date:
During looking stuff up for a discussion on -general, I realized that I'd
placed the check for newly created matching pk rows for on update no
action earlier than it needed to be so that it'd check even when the key
values hadn't changed.  This patch moves it to after checking for NULLs in
the old row and comparing the values since the select's probably more
expensive.

Regression tests appear to pass as do simple tests.

Attachment

Re: FK on update no action patch

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Stephan Szabo wrote:
>
> During looking stuff up for a discussion on -general, I realized that I'd
> placed the check for newly created matching pk rows for on update no
> action earlier than it needed to be so that it'd check even when the key
> values hadn't changed.  This patch moves it to after checking for NULLs in
> the old row and comparing the values since the select's probably more
> expensive.
>
> Regression tests appear to pass as do simple tests.

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: FK on update no action patch

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------



Stephan Szabo wrote:
>
> During looking stuff up for a discussion on -general, I realized that I'd
> placed the check for newly created matching pk rows for on update no
> action earlier than it needed to be so that it'd check even when the key
> values hadn't changed.  This patch moves it to after checking for NULLs in
> the old row and comparing the values since the select's probably more
> expensive.
>
> Regression tests appear to pass as do simple tests.

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073