"Kevin Martins" <martins506(at)hotmail(dot)com> writes:
> I've been working with SRF and i want to return a setof record but i
> keep getting this error cache lookup failed for type 18867840
That seems unlikely to be related to the code you've shown us.
Have you tried back-tracing from errfinish() to find out where the
error is being thrown?
regards, tom lane