Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XWHKq-00061q-9Z for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 04:04:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XWHKp-00089n-Ph for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 04:04:15 +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 1XWHKo-00089f-Np for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 04:04:14 +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 1XWHKl-0007uL-GR for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 04:04:13 +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 s8N443Zo005412; Tue, 23 Sep 2014 00:04:03 -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: <20140923035306.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> Comments: In-reply-to Alvaro Herrera message dated "Tue, 23 Sep 2014 00:53:06 -0300" Date: Tue, 23 Sep 2014 00:04:03 -0400 Message-ID: <5411.1411445043@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) 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: > FWIW I can reproduce the crash in 9.3 HEAD with these scripts, so that's > probably helpful enough. Table "Article" (not sent) is referenced in an > FK, but I just commented out that clause. Backtrace is: > #0 0x00007fd34d9ca1a5 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > #1 0x00007fd34d9cd420 in *__GI_abort () at abort.c:92 > #2 0x0000000000768c27 in ExceptionalCondition (conditionName=conditionName@entry=0x8c76b0 "!(!bms_overlap(appendrel->relids, required_outer))", > errorType=errorType@entry=0x7a080c "FailedAssertion", > fileName=fileName@entry=0x8c7470 "../../../../../../../../../../pgsql/source/REL9_3_STABLE/src/backend/optimizer/util/relnode.c", > lineNumber=lineNumber@entry=953) at ../../../../../../../../../../pgsql/source/REL9_3_STABLE/src/backend/utils/error/assert.c:54 Hm, probably the same thing then as http://www.postgresql.org/message-id/2326379.AOuSqtNClj@klinga.prans.org I was poking at that one earlier this evening. The immediate fix is clear enough (generate_implied_equalities_for_column should be considering "grandparent" appendrels), but I'm not sure yet whether we need to change the logic in generate_join_implied_equalities. In the meantime, the OP could probably dodge the problem by not nesting the UNION ALLs like that ... 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