On 2022-Aug-27, PG Doc comments form wrote: > Section 40.1. Overview of Event Trigger Behavior says: > "The table_rewrite event occurs just before a table is rewritten by some > actions of the commands ALTER TABLE and ALTER TYPE." > Issue: Neither the section nor the table describe which actions of ALTER > TABLE. If all actions fire the event trigger then section 40.1 should be > reworded to not suggest that some actions of ALTER table do not fire the > event trigger.
I don't follow. Not all actions fire that event trigger. Precisely the point of that event trigger type is to allow you to programmatically discover which actions do rewrite the table, without having to document them exactly. Partly, the reason for this is that some actions can avoid firing it under specific circumstances -- an example is SET DATA TYPE, which most of the time does fire it, but it can be skipped in some cases (say changing varchar(20) to varchar(40)). -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Ellos andaban todos desnudos como su madre los parió, y también las mujeres, aunque no vi más que una, harto moza, y todos los que yo vi eran todos mancebos, que ninguno vi de edad de más de XXX años" (Cristóbal Colón)