Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@lists.postgresql.org
Date: 2020-04-08T16:50:45Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes: > Hmm. Let's agree to what behavior we want, and then we implement that. > It seems to me there are two choices: > 1. on detach, keep the trigger but make it independent of the trigger on > parent. (This requires that the trigger is made dependent on the > trigger on parent, if the table is attached as partition again; > otherwise you'd end up with multiple copies of the trigger if you > detach/attach multiple times). > 2. on detach, remove the trigger from the partition. > I think (2) is easier to implement, but (1) is the more convenient > behavior. I think that #1 would soon lead to needing all the same infrastructure as we have for inherited columns and constraints, ie triggers would need equivalents of attislocal and attinhcount. I don't really want to go there, so I'd vote for #2. regards, tom lane
Commits
-
psql \d: Display table where trigger is defined, if inherited
- c33869cc3bfc 13.0 landed
-
Document partitiong tables ancillary object handling some more
- cda02408f20d 12.3 landed
- 97dcd5cd1500 11.8 landed
- 8803506c411e 13.0 landed
-
Fix detaching partitions with cloned row triggers
- e26c8a6b31e9 12.3 landed
- afccd76f1cce 13.0 landed
- 0b83c47216b0 11.8 landed