Re: Refcursor problem

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dmitry Fomichev <dfomichev(at)reldata(dot)com>, "'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 19:09:32
Message-ID: 200201031909.g03J9W216310@saturn.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> 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.

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(at)Yahoo(dot)com #

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-01-04 11:58:28 Bug #551: alter table add field serial - does not create serial field
Previous Message Bruce Momjian 2002-01-03 17:44:36 Re: [HACKERS] Bug #549: select table privilege in postgres allows