Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyKP6-00050I-8C for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jan 2013 10:51:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TyKP5-0007ge-9N for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jan 2013 10:51:31 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyKP3-0007gW-In for pgsql-hackers@postgresql.org; Thu, 24 Jan 2013 10:51:29 +0000 Received: from acidenitrix.villemain.org ([91.121.90.165]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyKP1-00036m-QG for pgsql-hackers@postgresql.org; Thu, 24 Jan 2013 10:51:28 +0000 Received: from [89.157.243.170] (helo=Dimitris-MacBook-Air.local) by acidenitrix.villemain.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TyKP0-0005vm-63; Thu, 24 Jan 2013 11:51:26 +0100 From: Dimitri Fontaine To: Robert Haas Cc: Alvaro Herrera , PostgreSQL Hackers Subject: Re: Event Triggers: adding information Organization: 2ndQuadrant References: <20130104205251.GB9191@alvh.no-ip.org> <20130109165829.GB4490@alvh.no-ip.org> User-Mail-Address: dimitri@2ndQuadrant.fr Date: Thu, 24 Jan 2013 11:51:12 +0100 In-Reply-To: (Robert Haas's message of "Wed, 23 Jan 2013 09:33:58 -0500") Message-ID: User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > Can you point me specifically at what you have in mind so I can make > sure I'm considering the right thing? Something like this part: + -- now try something crazy to ensure we don't crash the backend + create function test_event_trigger_drop_function() + returns event_trigger + as $$ + BEGIN + drop function test_event_trigger2() cascade; + END + $$ language plpgsql; + + create function test_event_trigger2() returns event_trigger as $$ + BEGIN + RAISE NOTICE 'test_event_trigger2: % %', tg_event, tg_tag; + END + $$ language plpgsql; + + create event trigger drop_test_a on "ddl_command_start" + when tag in ('create table') + execute procedure test_event_trigger_drop_function(); + + create event trigger drop_test_b on "ddl_command_start" + execute procedure test_event_trigger2(); + + create table event_trigger_fire1 (a int); + + -- then cleanup the crazy test + drop event trigger drop_test_a; + drop event trigger drop_test_b; + drop function test_event_trigger_drop_function(); The only problem for the regression tests being that there's an OID in the ouput, but with your proposed error message that would go away. -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers