Search Postgresql Archives

Re: Changes to not deferred FK in 8.0.3 to 7.4?

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

 



Janning Vygen <vygen@xxxxxx> writes:
> On more related question:
> I updated pg_trigger and pg_constraint and changed all my FK:

> UPDATE pg_trigger 
> SET 
>   tgdeferrable = true,
>   tginitdeferred = true
> WHERE tgconstrname LIKE 'fk_%'
> ;

> UPDATE pg_constraint
> SET 
>   condeferrable = true,
>   condeferred = true
> WHERE conname LIKE 'fk_%'
> ;

No, only the triggers that are for checks should be marked
deferrable/deferred.  These are the ones using functions
 RI_FKey_check_ins
 RI_FKey_check_upd
 RI_FKey_noaction_del
 RI_FKey_noaction_upd
You want the others nondeferrable because (a) that's the standard
behavior and (b) it'll ensure that the actions happen before the
checks are made.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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