Hi,

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

If I tweak the function, the size in the error message (2139062147) stays
the same.
However, if I change the function to

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


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

everything works fine. Am I missing something here? Workaround?
The OS is Linux Red Hat 7.1, kernel 2.4.5, glibc 2.2.4

Thanks for your help!

Dmitry Fomichev


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to