Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmdvc-00047e-4Y for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Nov 2021 15:29:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mmdva-0001ue-Qv for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Nov 2021 15:29:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmdva-0001uV-IM for pgsql-bugs@lists.postgresql.org; Mon, 15 Nov 2021 15:29:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmdvX-00065P-5h for pgsql-bugs@lists.postgresql.org; Mon, 15 Nov 2021 15:29:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AFFTjas2123409 for ; Mon, 15 Nov 2021 10:29:45 -0500 From: Tom Lane To: pgsql-bugs@lists.postgresql.org Subject: Bogus NULL object_name from pg_event_trigger_dropped_objects() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2123407.1636990185.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 15 Nov 2021 10:29:45 -0500 Message-ID: <2123408.1636990185@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I chanced to experiment with the event trigger function shown in 9.29.2. Processing Objects Dropped by a DDL Command [1]. I got et=3D# create table t1(f1 text primary key); CREATE TABLE et=3D# drop table t1; NOTICE: DROP TABLE dropped object: table public.t1 public.t1 NOTICE: DROP TABLE dropped object: type public.t1 public.t1 NOTICE: DROP TABLE dropped object: type public._t1 public.t1[] NOTICE: DROP TABLE dropped object: toast table pg_toast.pg_toast_38092 pg= _toast.pg_toast_38092 NOTICE: DROP TABLE dropped object: index pg_toast.pg_toast_38092_index pg= _toast.pg_toast_38092_index NOTICE: DROP TABLE dropped object: table constraint public. t1_pkey= on public.t1 NOTICE: DROP TABLE dropped object: index public.t1_pkey public.t1_pkey DROP TABLE et=3D# = Note the faulty output for the pkey constraint. I've not looked for the cause. regards, tom lane [1] https://www.postgresql.org/docs/current/functions-event-triggers.html#= PG-EVENT-TRIGGER-SQL-DROP-FUNCTIONS