Re: Refcursor problem - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Refcursor problem
Date
Msg-id 13431.1010078546@sss.pgh.pa.us
Whole thread Raw
In response to Refcursor problem  (Dmitry Fomichev <dfomichev@reldata.com>)
Responses Re: Refcursor problem  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-bugs
Dmitry Fomichev <dfomichev@reldata.com> writes:
> I am running 7.2b3 and trying to make something like this work (new
> refcursor stuff):

> CREATE TABLE t (c text);

> CREATE FUNCTION errtest(refcursor, text) RETURNS refcursor AS '
> BEGIN
>         OPEN $1 FOR SELECT c FROM t WHERE c=$2;
>         RETURN $1;
> END;
> ' LANGUAGE 'plpgsql';

> INSERT INTO t VALUES ('123');

> BEGIN;
> SELECT errtest('rs', '123');
> FETCH ALL IN rs;
> COMMIT;

> I am getting this error after FETCH ALL....

> psql:errtest.sql:15: ERROR:  MemoryContextAlloc: invalid request size
> 2139062147

Nasty.  It looks like SPI_cursor_open needs to be careful to copy
by-reference parameter values into the memory context created for
the cursor portal.  Will fix.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bug #549: select table privilege in postgres allows user to create index on the table
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Bug #549: select table privilege in postgres allows