Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzViq-00031v-T8 for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jan 2013 17:08:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TzVip-0007qz-De for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jan 2013 17:08:47 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzVin-0007qs-Fg for pgsql-hackers@postgresql.org; Sun, 27 Jan 2013 17:08:45 +0000 Received: from outbound.afilias.info ([66.199.183.4]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzVik-0003vN-Rn for pgsql-hackers@postgresql.org; Sun, 27 Jan 2013 17:08:43 +0000 Received: from ms5.on1.afilias-ops.info ([10.109.8.9] helo=smtp.afilias.info) by outbound.afilias.info with esmtp (Exim 4.69) (envelope-from ) id 1TzVij-0003kw-5G for pgsql-hackers@postgresql.org; Sun, 27 Jan 2013 17:08:41 +0000 Received: from mail-oa0-f71.google.com ([209.85.219.71]) by smtp.afilias.info with esmtps (TLSv1:RC4-SHA:128) (Exim 4.72) (envelope-from ) id 1TzVij-0006lL-4z for pgsql-hackers@postgresql.org; Sun, 27 Jan 2013 17:08:41 +0000 Received: by mail-oa0-f71.google.com with SMTP id n12so12336001oag.2 for ; Sun, 27 Jan 2013 09:08:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:message-id:date:from:user-agent:mime-version :to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=gnyhBPtOdcaEKuu87kPKDtffg+rqAeiuMyWB8uKnl08=; b=QMZsOXta4vqtOnmkAFDIgh/mRCpiuL3KPH8P23SUqrxH2EStDU2pqRJDwTzTU9ErfJ /REFHHwWytqdt1qHLMxT5W5pm9kNbI3BsWUZBs3jDDn9lp79E5RgcqK+CozWPfveTgpT bW0avKnwKzt/jb/y3OlmpasCjzqjAHhU7XUWw7G4mpDD0inC8yzrnOPXlgSmz6di7VfD kZw4z907Gqvnj22JHPrSh+Y1l7egmUEkYnLIy2GWSsHifEZ75N9An3xTrWSbfJ32z11m H7+TuLaPA+HuaGe7CAxINYf0wsffsAHo0ei0JTt5jYbz670I0u4uUxuCdIOb+hy/5Whq sdeQ== X-Received: by 10.50.190.199 with SMTP id gs7mr3163278igc.89.1359306516053; Sun, 27 Jan 2013 09:08:36 -0800 (PST) X-Received: by 10.50.190.199 with SMTP id gs7mr3163268igc.89.1359306515843; Sun, 27 Jan 2013 09:08:35 -0800 (PST) Received: from [192.168.1.5] ([64.231.26.170]) by mx.google.com with ESMTPS id eo7sm4475820igc.12.2013.01.27.09.08.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Jan 2013 09:08:35 -0800 (PST) Message-ID: <51055F11.6040208@ca.afilias.info> Date: Sun, 27 Jan 2013 12:08:33 -0500 From: Steve Singer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Robert Haas CC: Dimitri Fontaine , Andres Freund , Alvaro Herrera , PostgreSQL Hackers Subject: Re: Event Triggers: adding information References: <20130104205251.GB9191@alvh.no-ip.org> <20130109165829.GB4490@alvh.no-ip.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQl3NXW3nOidSXTvjiAYAJiwf7LP3L///DKVXNO3HML4CvYTqUOANfjC+xOO1yYbrtsSbXLDJB0Az4KR9dY2Zv9wzwNCE679IMiq7aVQMzaTgoHUXgZiJ5mfXHgU4OOrIelf+POPyG2vrq33mCnkYDoYV7msnOt1Qvj4735HGly1HLYFYmc= X-Pg-Spam-Score: -2.3 (--) 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 On 13-01-26 11:11 PM, Robert Haas wrote: > On Fri, Jan 25, 2013 at 11:58 AM, Dimitri Fontaine > wrote: >> My understanding is that if the command string we give to event triggers >> is ambiguous (sub-object names, schema qualifications, etc), it comes >> useless for logical replication use. I'll leave it to the consumers of >> that to speak up now. > > Yeah, that's probably true. I think it might be useful for other > purposes, but I think we need a bunch of infrastructure we don't have > yet to make logical replication of DDL a reality. > I agree. Does anyone have a specific use case other than DDL replication where an ambiguous command string would be useful? Even for use cases like automatically removing a table from replication when it is dropped, I would want to be able to determine which table is being dropped unambiguously. Could I determine that from an oid? I suspect so, but parsing a command string and then trying to figure out the table from the search_path doesn't sound very appealing. > Well, the point is that if you have a function that maps a parse tree > onto an object name, any API or ABI changes can be reflected in an > updated definition for that function. So suppose I have the command > "CREATE TABLE public.foo (a int)". And we have a call > pg_target_object_namespace(), which will return "public" given the > parse tree for the foregoing command. And we have a call > pg_target_object_name(), which will return "foo". We can whack around > the underlying parse tree representation all we want and still not > break anything - because any imaginable parse tree representation will > allow the object name and object namespace to be extracted. Were that > not possible it could scarcely be called a parse tree any longer. How do you get the fully qualified type of the first column? col1=pg_target_get_column(x, 0) pg_target_get_type(col1); or something similar. I think that could work but we would be adding a lot of API functions to get all the various bits of info one would want the API to expose. I also suspect executing triggers that had to make lots of function calls to walk a tree would be much slower than an extension that could just walk the parse-tree or some other abstract tree like structure. Steve -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers