Re: Refcursor problem - Mailing list pgsql-bugs

From Jan Wieck
Subject Re: Refcursor problem
Date
Msg-id 200201031909.g03J9W216310@saturn.jw.home
Whole thread Raw
In response to Re: Refcursor problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:
> 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.

    It doesn't do? Blame it on me. Thanks.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #556: Problem with ODBC Driver Version 7.1.9, DB Version 7.1.3
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #557: triggers tablename are not rename if table are renamed.