Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XXYpq-0001Xl-EA for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Sep 2014 16:57:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XXYpp-0004D7-IK for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Sep 2014 16:57:33 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XXYpo-0004D0-Go for pgsql-bugs@postgresql.org; Fri, 26 Sep 2014 16:57:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XXYpk-00010h-Nk for pgsql-bugs@postgresql.org; Fri, 26 Sep 2014 16:57:30 +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 s8QGvI9B007270; Fri, 26 Sep 2014 12:57:18 -0400 From: Tom Lane To: Alvaro Herrera cc: Nelson Page , Michael Paquier , "pgsql-bugs@postgresql.org" Subject: Re: BUG #11457: The below query crashes 9.3.5, but not 9.3.4 In-reply-to: <20140926154033.GD5311@eldon.alvh.no-ip.org> References: <20140920002314.2558.52018@wrigleys.postgresql.org> <4251b913e1464058b8e08d3e625bede3@BN3PR0401MB1265.namprd04.prod.outlook.com> <20140923035306.GD5311@eldon.alvh.no-ip.org> <5411.1411445043@sss.pgh.pa.us> <20140926154033.GD5311@eldon.alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Fri, 26 Sep 2014 12:40:33 -0300" Date: Fri, 26 Sep 2014 12:57:18 -0400 Message-ID: <7269.1411750638@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 Alvaro Herrera writes: > Nelson Page wrote: >> As mentioned in the original title, we cannot reproduce this crash in 9.3.4, but can in 9.3.5. So our particular crash does not go back to 9.1 (unless the 9.1 you mention is some other context maybe?) > Bug fixes are backpatched to supported branches; 9.3.4 is older than > 9.1.14. 9.1.14 does contain the backpatched bug fix which seems to have > introduced the new bug: The Assert failure mentioned in the other thread reproduces for me back to 9.2; that one is contingent on trying to build a parameterized path, so of course it wouldn't occur before 9.2. But I imagine other variants of this issue can be reproduced further back. The fundamental problem is that we still have work to do to make nested appendrels behave properly. I think basically the issue here is that in some situations we really want to find the top-level ancestor appendrel, not just the immediate parent, as it is the top-level ancestor that will be mentioned in join clauses, ORDER BY, etc. I came across a closely related issue too: in generate_join_implied_equalities_broken we try to translate original join clauses to apply to a particular child rel by applying the Var translation from the AppendRelInfo for that child. I think this is wrong for the same reasons: the original join clause will mention top-level ancestor Vars, meaning we need to successively apply all the translations working down to the descendant if we want a correct result. We could probably hack solutions to these problems without changing the AppendRelInfo data structures, but I'm wondering if it wouldn't be a good idea to redefine them or at least add more fields to make it easier to work with multi-level appendrel ancestry. 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