Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw203-0004eo-Hg for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 02:48:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tw202-0000yY-G1 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 02:48:10 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw200-0000wn-7m for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 02:48:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw1zz-0003ej-71 for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 02:48:07 +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 r0I2m2Zq023580; Thu, 17 Jan 2013 21:48:02 -0500 (EST) From: Tom Lane To: Andres Freund cc: Dimitri Fontaine , Simon Riggs , Robert Haas , Alvaro Herrera , PostgreSQL Hackers Subject: Re: Event Triggers: adding information In-reply-to: <20130118013334.GE3074@awork2.anarazel.de> References: <16675.1358454278@sss.pgh.pa.us> <18941.1358462151@sss.pgh.pa.us> <20130118013334.GE3074@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 18 Jan 2013 02:33:34 +0100" Date: Thu, 17 Jan 2013 21:48:01 -0500 Message-ID: <23579.1358477281@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 Andres Freund writes: > I have no problem requiring C code to use the even data, be it via hooks > or via C functions called from event triggers. The problem I have with > putting in some hooks is that I doubt that you can find sensible spots > with enough information to actually recreate the DDL for a remote system > without doing most of the work for command triggers. "most of the work"? No, I don't think so. Here's the thing that's bothering me about that: if the use-case that everybody is worried about is replication, then triggers of any sort are the Wrong Thing, IMO. The difference between a replication hook and a trigger is that a replication hook has no business changing any state of the local system, whereas a trigger *has to be expected to change the state of the local system* because if it has no side-effects you might as well not bother firing it. And the fear of having to cope with arbitrary side-effects occuring in the midst of DDL is about 80% of my angst with this whole concept. If we're only interested in replication, let's put in some hooks whose contract does not allow for side-effects on the local catalogs, and be done. Otherwise we'll be putting in man-years of unnecessary (or at least unnecessary for this use-case) work. 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