Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvy42-00084f-RL for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jan 2013 22:36:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tvy41-0001Qk-TK for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jan 2013 22:36:01 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvy40-0001Qe-JA for pgsql-hackers@postgresql.org; Thu, 17 Jan 2013 22:36:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvy3w-0004vj-UZ for pgsql-hackers@postgresql.org; Thu, 17 Jan 2013 22:36:00 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r0HMZqGC018942; Thu, 17 Jan 2013 17:35:52 -0500 (EST) From: Tom Lane To: Dimitri Fontaine cc: Simon Riggs , Robert Haas , Alvaro Herrera , PostgreSQL Hackers Subject: Re: Event Triggers: adding information In-reply-to: References: <20130104205251.GB9191@alvh.no-ip.org> <20130109165829.GB4490@alvh.no-ip.org> <16675.1358454278@sss.pgh.pa.us> Comments: In-reply-to Dimitri Fontaine message dated "Thu, 17 Jan 2013 22:51:03 +0100" Date: Thu, 17 Jan 2013 17:35:51 -0500 Message-ID: <18941.1358462151@sss.pgh.pa.us> 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 Dimitri Fontaine writes: > Tom Lane writes: >> I think that we're not realistically going to be able to introduce >> event triggers in very many of the places we'd like to have them >> without first doing a lot of fundamental refactoring. > We're only talking about ddl_command_start and ddl_command_end now. The > table_rewrite event is still on the horizon, but is not realistic to get > in 9.3 anymore, I think :( > So we're talking about adding some call points only in utility.c, only > before or after a ddl command is run, including nested sub-commands. Well, that's already a problem, because as Robert keeps saying, what goes through utility.c and what doesn't is pretty random right at the moment, and we shouldn't expose that behavior to users for fear of not being able to change it later. I think we could possibly ship event triggers defined as start and end of a *top level* command and have them working reliably in 9.3. If you want users to be looking at subcommands, there is a lot more work to do there than we have any chance of getting done for 9.3 (if it is to ship in 2013, that is). Alternatively, if you want to get something into 9.3 that has not necessarily got a long-term-stable API, I'd be inclined to suggest that we forget about a SQL-level event trigger facility for now, and just put in some hook call points. It's pretty well established that we're willing to change the API seen by hook functions across major releases. TBH this might be the best thing anyway if your long-term goals have to do with replication, because it'd be a lot cheaper to get to the point where you could write the replication code and see if it all actually works. I'm fairly concerned that we might spend many man-months getting event triggers with definitions A,B,C into the system, only to find out later that what is really needed for logical replication is definitions D,E,F. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers