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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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