There are SELECT INTO statements which work properly. Here is an example
which closes the backend:
CREATE FUNCTION plpgsql_call_handler ( ) RETURNS opaque AS '/usr/local/pgsql-7.1.1/lib/plpgsql.so' LANGUAGE 'C';
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL';
create table foo(x int4, y int4);
create function bugtest(int4) returns int4 as '
declare _x int4; _y int4;
begin select into _x,_y x, y from foo where x = $1 limit 1; return x;
end;
' language 'plpgsql';
select bugtest(5);
If the WHERE clause doesn't contain any input parameters (i.e. $1), I
don't get into any trouble.
Zoltan
-- Kov\'acs, Zolt\'an kovacsz@pc10.radnoti-szeged.sulinet.hu
http://www.math.u-szeged.hu/~kovzol ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz