Hi.

I think we should apply the attached patch so that a CreateTriggerStmt
that CloneRowTriggersToPartition creates for a partition doesn't contain
pointers that point to the information in the parent table's relcache,
which may go stale before the pointers in question are used.

Thanks,
Amit
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index fe4265d4bb..9b1194d15f 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -14560,7 +14560,8 @@ CloneRowTriggersToPartition(Relation parent, Relation 
partition)
 
                                col = TupleDescAttr(parent->rd_att,
                                                                        
trigForm->tgattr.values[i] - 1);
-                               cols = lappend(cols, 
makeString(NameStr(col->attname)));
+                               cols = lappend(cols,
+                                                          
makeString(pstrdup(NameStr(col->attname))));
                        }
                }
 

Reply via email to