Re: ERROR: cache lookup failed for type 0

From: Tzahi Fadida <tzahi_ml(at)myrealbox(dot)com>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: cache lookup failed for type 0
Date: 2005-01-07 19:51:30
Message-ID: 017c01c4f4f2$4e531ff0$0b00a8c0@llord
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It still doesn't work. btw, I am using 8rc2.
changed it to:
Datum result;
HeapTuple tupleCopy;
tupleCopy = heap_copytuple(tuple);
result = HeapTupleGetDatum(tupleCopy);
SRF_RETURN_NEXT(funcctx, result);

its probably something with the column description. the rows are
returned ok with select testgetrows();
but not with select * from testgetrows();

Regards,
tzahi.

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
> Sent: Friday, January 07, 2005 8:59 PM
> To: Tzahi Fadida
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] ERROR: cache lookup failed for type 0
>
>
> Tzahi Fadida <tzahi_ml(at)myrealbox(dot)com> writes:
> > Hi, I am learning how to use the c functions and my function below
> > works when I do: select testgetrows();
> > but when I do select * from testgetrows(); I am getting:
> > "ERROR: cache lookup failed for type 0"
> > Whats's the problem?
>
> I don't think it's safe to do HeapTupleGetDatum() directly on
> a tuple obtained from heap_getnext. You need to copy it.
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo(at)postgresql(dot)org
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian G. Pflug 2005-01-07 20:00:12 Problem creating trigger-function with arguments (8.0rc4)
Previous Message Tom Lane 2005-01-07 18:59:09 Re: ERROR: cache lookup failed for type 0