pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve handling of dropped objects in pg_event_trigger_ddl_comm
Date: Mon, 14 Jun 2021 05:58:57 +0000
Message-ID: <E1lsfcf-0005Ul-Mw@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1lsfcf-0005Ul-Mw@gemulon.postgresql.org>
Permalink:  ../E1lsfcf-0005Ul-Mw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lsfcf-0005Ul-Mw@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Improve handling of dropped objects in pg_event_trigger_ddl_comm
  In-Reply-To: <E1lsfcf-0005Ul-Mw@gemulon.postgresql.org>
  References: <E1lsfcf-0005Ul-Mw@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox