diff options
author | Amit Kapila <akapila@postgresql.org> | 2021-03-13 09:13:21 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2021-03-13 09:20:52 +0530 |
commit | c5be48f092016b1caf597b2e21d588b56c88a23e (patch) | |
tree | 1a94d063d7f536cf6d0d9f9d42155b110b510cd3 /src/backend/optimizer/util/clauses.c | |
parent | b9164eab208342d685638fc90048ffaa2688cb47 (diff) | |
download | postgresql-c5be48f092016b1caf597b2e21d588b56c88a23e.tar.gz postgresql-c5be48f092016b1caf597b2e21d588b56c88a23e.zip |
Improve FK trigger parallel-safety check added by 05c8482f7f.
Commit 05c8482f7f added special logic related to parallel-safety of FK
triggers. This is a bit of a hack and should have instead been done by
simply setting appropriate proparallel values on those trigger functions
themselves.
Suggested-by: Tom Lane
Author: Greg Nancarrow
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/2309260.1615485644@sss.pgh.pa.us
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 12754fdb2ba..ade66a541c8 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -971,24 +971,10 @@ target_rel_trigger_max_parallel_hazard(Relation rel, */ for (i = 0; i < rel->trigdesc->numtriggers; i++) { - int trigtype; Oid tgfoid = rel->trigdesc->triggers[i].tgfoid; if (max_parallel_hazard_test(func_parallel(tgfoid), context)) return true; - - /* - * If the trigger type is RI_TRIGGER_FK, this indicates a FK exists in - * the relation, and this would result in creation of new CommandIds - * on insert/update and this isn't supported in a parallel worker (but - * is safe in the parallel leader). - */ - trigtype = RI_FKey_trigger_type(tgfoid); - if (trigtype == RI_TRIGGER_FK) - { - if (max_parallel_hazard_test(PROPARALLEL_RESTRICTED, context)) - return true; - } } return false; |