From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Sven Klemm <sven@timescale.com>
Subject: Re: Fix dropped object handling in pg_event_trigger_ddl_commands
Date: Wed, 9 Jun 2021 09:55:08 -0400
Message-ID: <202106091355.sphciftmvqds@alvherre.pgsql> (raw)
In-Reply-To: <YMBRvAIZxJyQE5fv@paquier.xyz>
On 2021-Jun-09, Michael Paquier wrote:
> On Mon, Jun 07, 2021 at 12:44:42PM +0300, Aleksander Alekseev wrote:
> > I confirm that the bug still exists in master (be57f216). The patch
> > fixes it and looks good to me. I changed the wording a little and
> > added a regression test. The updated patch is in the attachment. I
> > added this thread to the CF and updated the status to "Ready for
> > Committer".
>
> FWIW, that looks rather natural to me to me to just ignore the object
> if it has already been dropped here. The same kind of rules apply to
> tables dropped with DROP TABLE which would not show up as of
> pg_event_trigger_ddl_commands(), but one can get a list as of
> pg_event_trigger_dropped_objects().
Oh, that parallel didn't occur to me. I agree it seems a useful
precedent.
> Alvaro, were you planning to look at that? I have not looked at the
> patch in details.
I have it on my list of things to look at, but it isn't priority. If
you to mess with it, please be my guest.
> missing_ok is available in getObjectIdentity() only
> since v14, so this cannot be backpatched :/
Ooh, yeah, I forgot about that. And that one was pretty invasive ...
I'm not sure if we can reasonably implement a fix for older releases.
I mean, it's a relatively easy test: do a syscache search for the object
or a catalog indexscan (easy to do with get_object_property_data-based
API), and if the object is gone, skip getObjectTypeDescription and
getObjectIdentity. But maybe this is too much code to add to stable
releases ...
--
Álvaro Herrera Valdivia, Chile
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, michael@paquier.xyz, aleksander@timescale.com, pgsql-hackers@lists.postgresql.org, sven@timescale.com
Subject: Re: Fix dropped object handling in pg_event_trigger_ddl_commands
In-Reply-To: <202106091355.sphciftmvqds@alvherre.pgsql>
* 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