Potential bug -- script that drops postgres server - Mailing list pgsql-general

From Lance Thomas
Subject Potential bug -- script that drops postgres server
Date
Msg-id 2571FD1F72F2D21189E50090273BF50FAF6B2F@NETBDC01
Whole thread Raw
Responses plpython trigger code is wrong (Re: Potential bug -- script that drops postgres server)
List pgsql-general
Postgres General:

First, I would like to thank you for your contribution with Postgres, a
wonderful database server that I use extensively.

Below is something that may be of interest -- a short, 7-statement script
that seems to drop my postgres server. Here's the following version
information for my system:

OS: Debian 3.0, Linux dev 2.2.19-reiserfs #1 SMP i686
Postgres: 7.2.1
Python: 2.1.1

Run the following inside of a blank database with plpython enabled:

CREATE TABLE "empcert" (
            "empcertid" integer,
            "employeeid" integer,
            "certid" integer,
            "empcertachieveddt" date,
            "createuser" integer,
            "createaccess" timestamp without time zone
);
 
CREATE TABLE "requirementswaiver" (
            "requirementswaiverid" integer,
            "requirementswaiveremployee" integer,
            "requirementswaiveragency" character varying(20),
            "requirementswaivergrade" character varying(20),
            "requirementswaivertype" text,
            "createuser" integer,
            "createaccess" timestamp without time zone
);
 
CREATE FUNCTION "log_insert" () RETURNS opaque AS '
    return None
' LANGUAGE 'plpython';
 
CREATE TRIGGER "empcert_log_insert_trigger" AFTER INSERT ON "empcert"  FOR
EACH ROW EXECUTE PROCEDURE "log_insert" ('empcert');
CREATE TRIGGER "requirementswaiver_log_insert_t" AFTER INSERT ON
"requirementswaiver"  FOR EACH ROW EXECUTE PROCEDURE "log_insert"
('requirementswaiver');
 
insert into empcert
(employeeid,certid,empcertachieveddt,createuser,createaccess) values
(2000000001,11,'2002-02-03',2000000001,now());
insert into requirementswaiver
(requirementswaiveremployee,requirementswaivertype,createuser,createaccess)
values (2000000001,'Training',2000000001,now());


You receive the following:


server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.


This behavior occurs on three out of four systems that we tested. The one
that worked was running an unstable version of debian linux. If you have any
information, feel free to let me know.

Thanks,

Lance Thomas

pgsql-general by date:

Previous
From: eric.cros@b2i-toulouse.com (Eric Cros)
Date:
Subject: PostGreSQL Replication question !!
Next
From: Teodor Sigaev
Date:
Subject: Re: [HACKERS] Alpha version of contrib/tsearch is available for testing