PL/R Median Busts Commit (Postgres 9.1.6 + plr 8.3.0.13 on Ubuntu 12.10 64 bit) - Mailing list pgsql-bugs

From Mark Kirkwood
Subject PL/R Median Busts Commit (Postgres 9.1.6 + plr 8.3.0.13 on Ubuntu 12.10 64 bit)
Date
Msg-id 5100B6B2.8030408@catalyst.net.nz
Whole thread Raw
Responses Re: PL/R Median Busts Commit (Postgres 9.1.6 + plr 8.3.0.13 on Ubuntu 12.10 64 bit)
List pgsql-bugs
I admit - it sounds unlikely. However a simple scenario (attached) gives
rise to:

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.

Regards

Mark



Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #7814: Rotation of the log is not carried out.
Next
From: Alvaro Herrera
Date:
Subject: Re: Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"