Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHZNO-0004UM-H7 for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2019 20:13:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHZNN-0008Ve-B6 for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2019 20:13:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHZNN-0008VS-0o for pgsql-general@lists.postgresql.org; Mon, 07 Oct 2019 20:13:01 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHZNG-00028L-Be for pgsql-general@postgresql.org; Mon, 07 Oct 2019 20:13:00 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1iHZNE-0007NC-5n; Mon, 07 Oct 2019 16:12:52 -0400 Date: Mon, 7 Oct 2019 16:12:52 -0400 From: Bruce Momjian To: Luca Ferrari Cc: Miles Elam , PG-General Mailing List Subject: Re: Event Triggers and Dropping Objects Message-ID: <20191007201252.GB4731@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Oct 5, 2019 at 10:50:14AM +0200, Luca Ferrari wrote: > On Fri, Oct 4, 2019 at 10:38 PM Miles Elam wrote: > > > > The event trigger firing matrix lists tags like DROP TABLE and DROP FUNCTION are listed below the ddl_command_end event, but when I created a basic audit table and event trigger, they don't seem to fire. I know sql_drop exists, but again the matrix lists DROP commands in the ddl_command_end event. > > Yes, I think this is a little misleading: > . > The ddl_command_end is issued, and the function is invoked, but > pg_event_trigger_ddl_commands() returns NULL on such invocation > because sql_drop is the event with the attached data. Do the Postgres docs need improvement here? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +