Re: enable/disable broken for statement triggers on partitioned tables
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Simon Riggs <simon.riggs@enterprisedb.com>
Date: 2022-08-03T18:01:48Z
Lists: pgsql-hackers
Attachments
- triggers-recurse-2.patch (text/x-diff) patch
- redo-add-column.patch (text/x-diff) patch
On 2022-Aug-02, Amit Langote wrote: > Regarding the patch, I agree that storing the recurse flag rather than > overwriting subtype might be better. > > + bool execTimeRecursion; /* set by ATPrepCmd if ATExecCmd must > + * recurse to children */ > > Might it be better to call this field simply 'recurse'? I think it's > clear from the context and the comment above the flag is to be used > during execution. Yeah, I guess we can do that and also reword the overall ALTER TABLE comment about recursion. That's in the attached first patch, which is intended as backpatchable. The second patch is just to show how we'd rewrite AT_AddColumn to no longer use the Recurse separate enum value but instead use the ->recurse flag. This is pretty straightforward and it's a clear net reduction of code. We can't backpatch this kind of thing of course, both because of the ABI break (easily fixed) and because potential destabilization (scary). We can do similar tihngs for the other AT enum values for recursion. This isn't complete since there are a few other values in that enum that we should process in this way too; I don't intend it to push it just yet. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "XML!" Exclaimed C++. "What are you doing here? You're not a programming language." "Tell that to the people who use me," said XML. https://burningbird.net/the-parable-of-the-languages/
Commits
-
Fix ENABLE/DISABLE TRIGGER to handle recursion correctly
- ec0925c22a3d 16.0 landed
- e78fd9084587 15.0 landed
- 731d514ae58f 14.5 landed
- ab855663012c 13.8 landed
- 6e7b37264e96 12.12 landed
- ce8e066521d1 11.17 landed