Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxcYi-0003F4-Pb for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jan 2013 12:02:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TxcYh-0005e9-MA for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jan 2013 12:02:31 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxcYf-0005e3-UG for pgsql-hackers@postgresql.org; Tue, 22 Jan 2013 12:02:30 +0000 Received: from acidenitrix.villemain.org ([91.121.90.165]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxcYb-00042I-Ie for pgsql-hackers@postgresql.org; Tue, 22 Jan 2013 12:02:29 +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 1TxcYY-0007PL-V1; Tue, 22 Jan 2013 13:02:23 +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: Tue, 22 Jan 2013 13:02:04 +0100 In-Reply-To: (Robert Haas's message of "Mon, 21 Jan 2013 18:07:15 -0500") Message-ID: User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 --=-=-= Content-Type: text/plain Robert Haas writes: > Nice clean patch, thanks! > > Committed, after tinkering with the CommandCounterIncrement() stuff a bit. Cool. thanks! > I will respond to the rest of your email later. Reading through this > patch left me with a slight concern regarding both ddl_command_start > and ddl_command_end: what happens if there's more than one event > trigger scheduled to fire, and one of them does something like drop > (with cascade) the function that a later one uses? Admittedly, that > seems like an unlikely case, but we probably want to check that > nothing too awful happens (e.g. crashing the server) and maybe add a > regression test to cover this scenario. I added some in the attached patch. doc/src/sgml/event-trigger.sgml | 10 ++ src/backend/commands/event_trigger.c | 6 +- src/test/regress/expected/event_trigger.out | 106 +++++++++++++++++++ src/test/regress/sql/event_trigger.sql | 47 ++++++++ 4 files changed, 167 insertions(+), 2 deletions(-) I had to make quiet a part of the regression tests because of the ERROR message containing an OID, where I think it's the right error message. I don't think we want to add complexity to the code to be able to report the procedure name that we depend on in the event cache and that the user just deleted while in the middle of actually running the event trigger list we already got from the cache, right? "Dickson S. Guedes" writes: > 2013/1/21 Robert Haas : >> Another thing is that we might want to document that if a command >> errors out, ddl_command_end will never be reached; and perhaps also >> that if ddl_command_start errors out, the command itself will never be >> reached. Perhaps this is so obvious as to not bear mentioning, I >> don't know, but the thought crossed my mind that someone might fail to >> realize it. > > I think that should be a mention about that in docs, someone could > expect that ddl_command_end be reached even when > ddl_command_start erros out, and try to use it in some way. Yeah, I share both your views. I've been playing with event triggers for too long to think about such documentation it seems, thanks for reminding me about it. Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=event_trigger_harness.v0.patch.gz Content-Transfer-Encoding: base64 H4sIAA9+/lACA+1abVMbtxb+TH7FKZMG2zXYQAlJeJlJjNPLlIFcSmf6zSPv nl2r7EobSctLZ/rf7zmSFmxiCjRpb9OxZ2BWu0ePHp03aXW20+mA6KU66VlD f3lZ9PAClVt1RuY5mjW+9Wx1dRXGD0p1Zn/chq2N7tY2+CaDU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/010O/5iidoU8OD0LpnvSPXL1WOVpAwQdossSGsfVFOskKKKUalcRGsCDR z4QTxc4Tj9loOvMRox4dG8lXBWOpLR7G0+wf5SJ/KDG+kXiCu+889eyVP+C4 PXmFOCtSMn8QwzXAkx93wqk9JtoXMbCp6CDHjYjDNXWU2dmQV4VPPu4pf+38 2W731BLtx+JOUZDu3FdGnC88t/a01V3v90PxaQ7duSRD6ZB7fn/zuQHdaKph 5PvdO/UmrgfdN+Pe5gOFqkV56LPLQ19Vheb/VST5G+skX6ZU8tcv9P/gtX6x 3H+x5f6fvOJ/Pev2/wC1fr5THSwAAA== --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --=-=-=--