Re: BUG #6708: pgsql_fdw's foreign table cann't used in plpgsql function - Mailing list pgsql-bugs

From Shigeru HANADA
Subject Re: BUG #6708: pgsql_fdw's foreign table cann't used in plpgsql function
Date
Msg-id 4FF3B358.9040307@gmail.com
Whole thread Raw
In response to BUG #6708: pgsql_fdw's foreign table cann't used in plpgsql function  (digoal@126.com)
List pgsql-bugs
(2012/06/27 9:02), digoal@126.com wrote:
> pgsql_fdw's foreign table "cache lookup failed for type 0" bug when used in
> function

Thanks for the report!

I could reproduce the problem.  The cause of error was wrong handling of
parameters given by PL/pgSQL for PL/pgSQL variables and parameters.

They need instantiation with callback routine, and might have InvalidOid
(0) for type oid.  I fixed pgsql_fdw for two points:

1) instantiate parameters given by PL/pgSQL with callback function
2) use TEXTOID for type-unknown parameters which are not used in remote
query

Please try HEAD of git.
    https://sourceforge.net/projects/interdbconnect/develop

Regards,
--
Shigeru HANADA

pgsql-bugs by date:

Previous
From: jgd@well.com
Date:
Subject: BUG #6715: 9.2b2 psql \ir does not understand leading ../
Next
From: Tom Lane
Date:
Subject: Re: BUG #6715: 9.2b2 psql \ir does not understand leading ../