Search Postgresql Archives

Re: Foreign key verification trigger conditions

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

 



j-lists <jamisonlists@xxxxxxxxx> writes:
> I have an update statement that affects every row in a given table.
> For that table it changes the value in a single column, which itself
> has a foreign key constraint. The table has an additional 9 foreign
> keys, some of which reference large tables.
> My expectation would be that only the changed column would be checked
> against the foreign key of interest, instead I find that all the
> foreign keys are checked when this statement is executed.

What your test case actually seems to show is that the skip-the-trigger
optimization doesn't fire when the column value is NULL.  Which is
because ri_KeysEqual() doesn't consider two nulls to be equal.  It's
possible we could change that but I'd be worried about breaking other
cases that are actually semantically critical...

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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