Bug #662: In plpgsql, returning "text" instead of "setof text" puts backend in infinite loop

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #662: In plpgsql, returning "text" instead of "setof text" puts backend in infinite loop
Date: 2002-05-10 03:05:12
Message-ID: 20020510030512.2DB814759F6@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Kristis Makris (kristis(dot)makris(at)datasoft(dot)com) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
In plpgsql, returning "text" instead of "setof text" puts backend in infinite loop

Long Description
This was run against postgres 7.1.3. While experimenting with "setof" in writing a plpgsql function I came across a case where if text is returned in place of setof text, the backend never came up with a reply. top reported the postmaster running at %99.9 until I Ctrl-C'ed.

Sure, text should not be returned in place of setof text, but still...

=# select AAA(now());

Cancel request sent
ERROR: Query was cancelled.
=#

Sample Code
create function AAA(date) returns setof text as '
declare
-- _date alias for $1;

_reads text;
begin

return _reads;
end;
' language 'plpgsql';

SELECT AAA(now());

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-05-10 04:12:46 Bug #663: ERROR: SearchSysCache: Bad cache id 27
Previous Message Tatsuo Ishii 2002-05-09 01:27:01 Re: Bug #659: lower()/upper() bug on ->multibyte<- DB