Re: BUG #6708: pgsql_fdw's foreign table cann't used in plpgsql function

From: Shigeru HANADA <shigeru(dot)hanada(at)gmail(dot)com>
To: digoal(at)126(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6708: pgsql_fdw's foreign table cann't used in plpgsql function
Date: 2012-07-04 03:07:04
Message-ID: 4FF3B358.9040307@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

(2012/06/27 9:02), digoal(at)126(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-07-04 06:41:46 Re: BUG #6715: 9.2b2 psql \ir does not understand leading ../
Previous Message jgd 2012-07-04 02:55:30 BUG #6715: 9.2b2 psql \ir does not understand leading ../