Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aSVXx-0003fd-Hn for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Feb 2016 20:03:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aSVXw-00008K-S8 for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Feb 2016 20:03:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aSVXL-0007td-3f for pgsql-bugs@postgresql.org; Sun, 07 Feb 2016 20:02:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aSVXI-00082H-CB for pgsql-bugs@postgresql.org; Sun, 07 Feb 2016 20:02:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u17K2Bu8022767; Sun, 7 Feb 2016 15:02:12 -0500 From: Tom Lane To: Andres Freund cc: Peter Geoghegan , =?utf-8?B?w5ZuZGVyIEthbGFjxLE=?= , pgsql-bugs Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres In-reply-to: <20160204211534.j7wwi56b62mjcvfo@alap3.anarazel.de> References: <20160126123420.2539.85100@wrigleys.postgresql.org> <20160204121141.bl3dbdnv2vipl4j5@alap3.anarazel.de> <20160204204908.ew45cz73rsjgyptd@alap3.anarazel.de> <20160204211534.j7wwi56b62mjcvfo@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 04 Feb 2016 22:15:34 +0100" Date: Sun, 07 Feb 2016 15:02:11 -0500 Message-ID: <22766.1454875331@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andres Freund writes: > On 2016-02-04 13:09:43 -0800, Peter Geoghegan wrote: >> Sorry, I still don't get it. How does that help with ON CONFLICT >> arbiter WHERE clause deparsing? > The bug this thread is about was actually visible in regression test > output, as the wrong output of pg_rules output. As were a number of > previous bugs. So it seems time to actually make sure that the output of > the rules we generate to test deparsing actually do something remotely > sane, by executing the deparsed sql. Obviously human inspection is not > sufficient. You can do so by executing deparsed output of a rule or a > view (both should be doable afacis). That's all very well, but we have a release to get out tomorrow, so I went ahead and pushed Peter's patch (with some cosmetic fiddling). I think actually Andres' proposal wouldn't be all that helpful, because it would only detect deparse problems for constructs that happen to appear in views/rules that exist at the instant the test runs. What I'd be inclined to think about is something comparable to the COPY_PARSE_PLAN_TREES #define, that is an option to make postgres.c pass every non-utility statement through deparse and reparse and then compare the resulting parse trees. It'd be a bit slow but it would cover every type of syntax exercised anywhere in the regression tests. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs