Skip site navigation (1) Skip section navigation (2)

PostgreSQL 7.1.1: Backend crash when calling plpgsql function

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: PostgreSQL 7.1.1: Backend crash when calling plpgsql function
Date: 2001-05-09 12:54:03
Message-ID: 200105091254.f49Cs3l62185@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
 (bs(at)niggard(dot)org) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
PostgreSQL 7.1.1: Backend crash when calling plpgsql function

Long Description
Hi, while porting a 6.5 app to 7.1.1 i found a plpgsql function that crashes the backend. Other functions work though. When i rewrite the function to be more sane, the crash doesnt happen anymore. Still the backend shouldnt crash (and it didnt in 6.5 btw).

The whole db dump is about 28megs if anyone is interested.

In case it matters: the 7.1.1 was installed over a 7.0.3, so maybe there is some plpgsql versioning conflict??

Thanks.


Sample Code
Crashing function:
CREATE FUNCTION "new_news" (varchar ) RETURNS int4 AS '
        DECLARE
                uid_p varchar;
        BEGIN
                Select l.uid into uid_p from nachrichten2 n2, luser l
                WHERE l.uid = $1
                AND l.uid = n2.uid
                AND id > letzte_nachricht
                group by l.uid;
                IF uid_p ISNULL THEN
                        RETURN 0;
                END IF;
                RETURN 1;
        END;
        ' LANGUAGE 'plpgsql';

Not crashing function:
CREATE FUNCTION "new_news" (varchar ) RETURNS int4 AS '
        BEGIN
                IF NOT EXISTS(
                        Select l.uid from nachrichten2 n2, luser l
                        WHERE l.uid = $1  
                        AND l.uid = n2.uid
                        AND id > letzte_nachricht 
                ) THEN
                        RETURN 0;
                END IF;
                RETURN 1;
        END;
        ' LANGUAGE 'plpgsql';



No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-05-09 13:15:16
Subject: Another plpgsql crash
Previous:From: Tom LaneDate: 2001-05-08 20:35:26
Subject: Re: New tests for new bugs (was Re: [BUGS] Re: backend dies on 7.1.1 loading large datamodel.)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group