Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ4aT-0002En-5a for pgsql-general@arkaria.postgresql.org; Wed, 10 Apr 2013 23:37:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQ4aS-0006YL-L7 for pgsql-general@arkaria.postgresql.org; Wed, 10 Apr 2013 23:37:56 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ4aR-0006XG-2F for pgsql-general@postgresql.org; Wed, 10 Apr 2013 23:37:55 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ4aO-0003NZ-L2 for pgsql-general@postgresql.org; Wed, 10 Apr 2013 23:37:54 +0000 Received: from anarazel.de (p5DDC610D.dip.t-dialin.net [93.220.97.13]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MAkiB-1UJifT3OKB-00C4qo; Thu, 11 Apr 2013 01:37:44 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 336671C00F7; Thu, 11 Apr 2013 01:37:44 +0200 (CEST) Date: Thu, 11 Apr 2013 01:37:44 +0200 From: Andres Freund To: Tom Lane Cc: Joshua Berry , PostgreSQL - General Subject: Re: Segmentation fault with core dump Message-ID: <20130410233744.GF7547@awork2.anarazel.de> References: <20130410214929.GA7547@awork2.anarazel.de> <20130410222233.GB7547@awork2.anarazel.de> <12385.1365633318@sss.pgh.pa.us> <13081.1365635172@sss.pgh.pa.us> <20130410232131.GD7547@awork2.anarazel.de> <13612.1365636546@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13612.1365636546@sss.pgh.pa.us> X-Provags-ID: V02:K0:rV/7wn+pVAm84rnol/GbQ2N15kxhOwaF04eIu8rXNrt qOPUSkIxXomJSBwJW2MfevhhUaokZNiemcueePzS0ra6tKFk5y M+47RWrbEhMUQMp6cAjznOwuER26m40CktsAlFDzLjKXwYm/d9 RQaETVraI0oltjQiFr0+3ouFKzZahF4Ceg1lxBqNm2gVxxyvKH N6zujVscLGxDbbWWcGrcuq3XQ4Aw+X/gnIOldgtrPhzoEGb48n BJl41E08zMkuQQsaJpI3pTFxSqZ8R+nV1Y7IZSy9DNRz7dTE1Q n53CG5M4yrIgq4AN9CeAANLWg/4BedwI0n4qh9pdx5yJH7jNSW UhX0tzkGVpJLO/NQfdJ2zDJQmEGg1glJEGEyeVH8r X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 2013-04-10 19:29:06 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2013-04-10 19:06:12 -0400, Tom Lane wrote: > >> And the answer is they're not testing this code path at all, because if > >> you do > >> DECLARE c CURSOR WITH HOLD FOR ... > >> FETCH ALL FROM c; > >> then the second query executes with a portal (and resource owner) > >> created to execute the FETCH command, not directly on the held portal. > > > But in that path CurrentResourceOwner gets reset to portal->resowner as > > well (see PortalRunFetch())? > > Right, but that's the FETCH's portal, which is a regular "live" portal > that has a ResOwner. I don't think so? standard_ProcessUtility: PerformPortalFetch: /* get the portal from the portal name */ portal = GetPortalByName(stmt->portalname); ... /* Do it */ nprocessed = PortalRunFetch(portal, stmt->direction, stmt->howMany, dest); PortalRunFetch: PG_TRY(); { ActivePortal = portal; CurrentResourceOwner = portal->resowner; So it seems to trigger a very similar codepath? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general