Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BCC45514018 for ; Fri, 9 Mar 2012 11:05:27 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S61Nk-0004NN-6Q for pgsql-hackers@postgresql.org; Fri, 09 Mar 2012 15:05:26 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q29F56AA029001; Fri, 9 Mar 2012 10:05:06 -0500 (EST) To: Robert Haas cc: Thom Brown , Dimitri Fontaine , pgsql-hackers@postgresql.org, Andres Freund Subject: Re: Command Triggers, patch v11 In-reply-to: References: <201203041650.39826.andres@anarazel.de> Comments: In-reply-to Robert Haas message dated "Fri, 09 Mar 2012 09:30:14 -0500" Date: Fri, 09 Mar 2012 10:05:05 -0500 Message-ID: <29000.1331305505@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/584 X-Sequence-Number: 204466 Robert Haas writes: > On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown wrote: >> Sorry, I meant any command trigger.  It's because none of the commands >> can be run on a standby, so the triggers don't seem appropriate. > I'm not convinced. Right now, it's fairly useless - all the triggers > could possibly do is throw an error, and an error is going to get > thrown anyway, so it's only a question of which error message the user > will see. But we discussed before the idea of adding a capability for > BEFORE triggers to request that the actual execution of the command > get skipped, and then it's possible to imagine this being useful. Um, surely the "you can't do that in a read-only session" error is going to get thrown long before the command trigger could be called? regards, tom lane