Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwGam-0001xC-8M for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 18:23:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TwGal-0001DU-OB for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 18:23:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwGaj-0001C6-Mr for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 18:23:01 +0000 Received: from smtprelay0024.b.hostedemail.com ([64.98.42.24] helo=smtprelay.b.hostedemail.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwGai-0006Nv-5y for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 18:23:01 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay02.b.hostedemail.com (Postfix) with SMTP id AA79B39C98; Fri, 18 Jan 2013 18:22:58 +0000 (UTC) X-Panda: scanned! X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::::::::::, RULES_HIT:355:379:599:601:945:967:973:988:989:1028:1260:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2198:2199:2393:2525:2561:2564:2682:2685:2693:2828:2859:2903:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:4659:5007:6119:6261:7679:7903:8957:9010:9025:9121:10004:10400:10848:10967:11256:11257:11658:11914:12043:12438:12517:12519:12555:12740, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Filterd-Recvd-Size: 3459 Received: from perhan.alvh.no-ip.org (unknown [190.95.28.201]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf03.b.hostedemail.com (Postfix) with ESMTPA; Fri, 18 Jan 2013 18:22:58 +0000 (UTC) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id BFAC26E0B6; Fri, 18 Jan 2013 15:22:55 -0300 (CLST) Date: Fri, 18 Jan 2013 15:22:55 -0300 From: Alvaro Herrera To: Andres Freund Cc: Tom Lane , Robert Haas , Dimitri Fontaine , Simon Riggs , PostgreSQL Hackers Subject: Re: Event Triggers: adding information Message-ID: <20130118182255.GG4063@alvh.no-ip.org> References: <20130118013334.GE3074@awork2.anarazel.de> <20130118140721.GA29501@alap2.anarazel.de> <20130118154732.GE29501@alap2.anarazel.de> <20130118170857.GK29501@alap2.anarazel.de> <10183.1358531053@sss.pgh.pa.us> <20130118180326.GM29501@alap2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20130118180326.GM29501@alap2.anarazel.de> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 0.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 Andres Freund escribi=F3: > On 2013-01-18 12:44:13 -0500, Tom Lane wrote: > > An issue that would have to be thought about is that there are assorted > > scenarios where we generate "parse trees" that contain options that > > cannot be generated from SQL, so there's no way to reverse-list them > > into working SQL. But often those hidden options are essential to know > > what the statement will really do, so I'm not sure ignoring them will be > > a workable answer for replication purposes. >=20 > Dimitri's earlier patches had support for quite some commands via > deparsing and while its a noticeable amount of code it seemed to work > ok. > The last revision I could dig out is > https://github.com/dimitri/postgres/blob/d2996303c7bc6daa08cef23e3d5e07c3= afb11191/src/backend/utils/adt/ddl_rewrite.c >=20 > I think some things in there would have to change (e.g. I doubt that its > good that EventTriggerData is involved at that level) but I think it > shows very roughly how it could look. I looked at that code back then and didn't like it very much. The problem I see (as Robert does, I think) is that it raises the burden when you change the grammar -- you now need to edit not only gram.y, but the ddl_rewrite.c stuff to ensure your new thing can be reverse-parsed. One idea I had was to add annotations on gram.y so that an external (Perl?) program could generate the ddl_rewrite.c equivalent, without forcing the developer to do it by hand. Another problem is what Tom mentions: there are internal options that cannot readily be turned back into SQL. We would have to expose these at the SQL level somehow; but to me that looks painful because we would be offering users the option to break their systems by calling commands that do things that should only be done internally. --=20 =C1lvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers