PostgreSQL 7.1.1: Backend crash when calling plpgsql function - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject PostgreSQL 7.1.1: Backend crash when calling plpgsql function
Date
Msg-id 200105091254.f49Cs3l62185@hub.org
Whole thread Raw
Responses Re: PostgreSQL 7.1.1: Backend crash when calling plpgsql function
Re: PostgreSQL 7.1.1: Backend crash when calling plpgsql function
List pgsql-bugs
(bs@niggard.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.
Wheni rewrite the function to be more sane, the crash doesnt happen anymore. Still the backend shouldnt crash (and it
didntin 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: debug_level 0 does not stop debug messages
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Another plpgsql crash