Re: bug in PLPGSQL

From: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: Jan Wieck <JanWieck(at)yahoo(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug in PLPGSQL
Date: 2001-05-14 09:52:38
Message-ID: Pine.LNX.4.21.0105141148540.1153-100000@pc10.radnoti-szeged.sulinet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu
http://www.math.u-szeged.hu/~kovzol
ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Franck Martin 2001-05-14 11:01:23 Re: Re: 7.2 items
Previous Message Hiroshi Inoue 2001-05-14 09:48:24 Re: bug in PLPGSQL