Re: Event trigger code comment duplication
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-05-12T06:30:09Z
Lists: pgsql-hackers
Attachments
- event_trigger_comment.patch (text/x-diff) patch
On Mon, May 11, 2020 at 05:13:38PM -0700, David G. Johnston wrote: > Skimming through the code in event_trigger.c and noticed that while most of > the stanzas that reference IsUnderPostmaster refer back to the code comment > beginning on line 675 the block for table rewrite copied it in > verbatim starting at line 842. The currentEventTriggerState comment at > lines 730 and 861 seem to be the same too. An even more interesting part here is that EventTriggerDDLCommandEnd() and Drop() have basically the same comments, but they tell to refer back toEventTriggerDDLCommandStart(). So let's just do the same for all the exact duplicate in EventTriggerTableRewrite(). The second point about the check with (!currentEventTriggerState) in EventTriggerTableRewrite() and EventTriggerDDLCommandEnd() shows that both comments share the same first sentence, but there is enough different context to just keep them as separate IMO. > I did also notice a difference with the test on line 861 compared to line > 785 though I unable to evaluate whether the absence of a "rewriteList" is > expected (there is a "dropList" at 785 ...). An event table rewrite happens only for one relation at a time. In short, something like the attached sounds enough to me. What do you think? -- Michael
Commits
-
Remove duplicated comment block in event_trigger.c
- ff87fabef20e 13.0 landed
-
Doc: fix remaining over-length entries in SQL keywords table.
- 4d1563717fb1 13.0 cited
-
Doc: fix "Unresolved ID reference" warnings, clean up man page cross-refs.
- 60c90c16c188 13.0 cited