Skip site navigation (1) Skip section navigation (2)

Re: Refcursor problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Fomichev <dfomichev(at)reldata(dot)com>
Cc: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>, Jan Wieck <JanWieck(at)Yahoo(dot)com>
Subject: Re: Refcursor problem
Date: 2002-01-03 17:22:26
Message-ID: 13431.1010078546@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Dmitry Fomichev <dfomichev(at)reldata(dot)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

In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2002-01-03 17:30:25
Subject: Re: [HACKERS] Bug #549: select table privilege in postgres allows
Previous:From: Tom LaneDate: 2002-01-03 16:54:21
Subject: Re: Bug #549: select table privilege in postgres allows user to create index on the table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group