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.
https://github.com/postgres/postgres/blob/60c90c16c1885bb9aa2047b66f958b865c5d397e/src/backend/commands/event_trigger.c#L675 https://github.com/postgres/postgres/blob/60c90c16c1885bb9aa2047b66f958b865c5d397e/src/backend/commands/event_trigger.c#L730 https://github.com/postgres/postgres/blob/60c90c16c1885bb9aa2047b66f958b865c5d397e/src/backend/commands/event_trigger.c#L842 https://github.com/postgres/postgres/blob/60c90c16c1885bb9aa2047b66f958b865c5d397e/src/backend/commands/event_trigger.c#L861 https://github.com/postgres/postgres/blob/4d1563717fb1860168a40b852e1d61a33ecdd62f/src/backend/commands/event_trigger.c#L785 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 ...). David J.