Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyLdR-0008O4-3X for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2017 17:00:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cyLdP-0005XS-IL for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2017 17:00:47 +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_2) (envelope-from ) id 1cyLdN-0005VM-Kz for pgsql-hackers@postgresql.org; Wed, 12 Apr 2017 17:00:45 +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_2) (envelope-from ) id 1cyLdL-0001AR-BL for pgsql-hackers@postgresql.org; Wed, 12 Apr 2017 17:00:44 +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 v3CH0b62018989; Wed, 12 Apr 2017 13:00:37 -0400 From: Tom Lane To: Amit Kapila cc: Andreas Seltenreich , pgsql-hackers , Robert Haas Subject: Re: [sqlsmith] ERROR: badly formatted node string "RESTRICTINFO... In-reply-to: References: <87tw5x4vcu.fsf@credativ.de> <11668.1491753112@sss.pgh.pa.us> <9631.1491863013@sss.pgh.pa.us> <23397.1491868771@sss.pgh.pa.us> <30972.1491937807@sss.pgh.pa.us> Comments: In-reply-to Amit Kapila message dated "Wed, 12 Apr 2017 17:59:39 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18987.1492016437.1@sss.pgh.pa.us> Date: Wed, 12 Apr 2017 13:00:37 -0400 Message-ID: <18988.1492016437@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Amit Kapila writes: > On Wed, Apr 12, 2017 at 12:40 AM, Tom Lane wrote: >> Anyone want to draft a patch for this? > Please find patch attached based on above discussion. This patch seems fairly incomplete: you can't just whack around major data structures like PlannedStmt and PlannerGlobal without doing the janitorial work of cleaning up support logic such as outfuncs/readfuncs. Also, when you think about what will happen when doing a copyObject() on a completed plan, it seems like a pretty bad idea to link subplans into two independent lists. We'll end up with two separate copies of those subtrees in places like the plan cache. I'm inclined to think the other approach of adding a parallel_safe flag to struct Plan is a better answer in the long run. It's basically free to have it there because of alignment considerations, and it's hard to believe that we're not going to need that labeling at some point in the future anyway. I had been a bit concerned about having to have some magic in outfuncs and/or readfuncs to avoid transferring the unsafe subplan(s), but I see from your patch there's a better way: we can have ExecSerializePlan modify the subplan list as it transfers it into its private PlannedStmt struct. But I think iterating over the list and examining each subplan's parallel_safe marking is a better way to do that. Will work on this approach. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers