pgsql: Improve handling of dropped objects in pg_event_trigger_ddl_comm - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Improve handling of dropped objects in pg_event_trigger_ddl_comm
Date
Msg-id E1lsfcf-0005Ul-Mw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve handling of dropped objects in pg_event_trigger_ddl_commands()

An object found as dropped when digging into the list of objects
returned by pg_event_trigger_ddl_commands() could cause a cache lookup
error, as the calls grabbing for the object address and the type name
would fail if the object was missing.

Those lookup errors could be seen with combinations of ALTER TABLE
sub-commands involving identity columns.  The lookup logic is changed in
this code path to get a behavior similar to any other SQL-callable
function by ignoring objects that are not found, taking advantage of
2a10fdc.  The back-branches are not changed, as they require this commit
that is too invasive for stable branches.

While on it, add test cases to exercise event triggers with identity
columns, and stress more cases with the event ddl_command_end for
relations.

Author: Sven Klemm, Aleksander Alekseev, Michael Paquier
Discussion: https://postgr.es/m/CAMCrgp2R1cEXU53iYKtW6yVEp2_yKUz+z=3-CTrYpPP+xryRtg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2d689babe3cb50dcb29f6ed595a61d56e518c0d8

Modified Files
--------------
src/backend/commands/event_trigger.c        | 15 +++++++-
src/test/regress/expected/event_trigger.out | 57 +++++++++++++++++++++++++++--
src/test/regress/sql/event_trigger.sql      | 26 ++++++++++++-
3 files changed, 91 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Remove forced toast recompression in VACUUM FULL/CLUSTER
Next
From: Bruce Momjian
Date:
Subject: pgsql: doc: add PG 14 relnote item about array function references