Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyOVZ-0004O5-ND for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Jan 2013 15:14:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TyOVZ-0006bw-39 for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Jan 2013 15:14:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyOVW-0006aC-7s for pgsql-bugs@postgresql.org; Thu, 24 Jan 2013 15:14:26 +0000 Received: from wsip-72-214-29-243.sd.sd.cox.net ([72.214.29.243] helo=joeconway.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyOVU-0003q4-Pd for pgsql-bugs@postgresql.org; Thu, 24 Jan 2013 15:14:25 +0000 Received: from [178.201.81.190] (account jconway HELO [192.168.50.43]) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 12680584; Thu, 24 Jan 2013 07:19:53 -0800 Message-ID: <51014FCB.30601@joeconway.com> Date: Thu, 24 Jan 2013 16:14:19 +0100 From: Joe Conway User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Mark Kirkwood CC: "pgsql-bugs@postgresql.org" Subject: Re: PL/R Median Busts Commit (Postgres 9.1.6 + plr 8.3.0.13 on Ubuntu 12.10 64 bit) References: <5100B6B2.8030408@catalyst.net.nz> In-Reply-To: <5100B6B2.8030408@catalyst.net.nz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.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 On 01/24/2013 05:21 AM, Mark Kirkwood wrote: > I admit - it sounds unlikely. However a simple scenario (attached) gives > rise to: This is the wrong place for the bug report on PL/R I think, but I'll take a look. Joe > WARNING: AbortTransaction while in COMMIT state > PANIC: cannot abort transaction 880983, it was already committed > > Essentially we are doing: > > BEGIN; > DROP TABLE IF EXISTS tab0; > CREATE TEMP TABLE tab0 ( id INTEGER PRIMARY KEY, val TEXT); > INSERT INTO tab0 SELECT generate_series(1,1000),'xxxxxxxxxx'; > SELECT median(id) FROM tab0; > DROP TABLE IF EXISTS tab1; > CREATE TEMP TABLE tab1 ( id INTEGER PRIMARY KEY, val TEXT); > INSERT INTO tab1 SELECT generate_series(1,1000),'xxxxxxxxxx'; > DROP TABLE IF EXISTS tab2; > ... > DROP TABLE IF EXISTS tab99; > CREATE TEMP TABLE tab99 ( id INTEGER PRIMARY KEY, val TEXT); > INSERT INTO tab99 SELECT generate_series(1,1000),'xxxxxxxxxx'; > SELECT median(id) FROM tab99; > COMMIT; > > > We crash at commit. > > Changing median to something else (e.g avg or even a non PLR median > function) makes the error vanish, so its either PLR or the specific PLR > median function causing the grief. -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs