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

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 (view raw or flat)
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

pgsql-bugs by date

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

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