Re: Postgres Stored Procedure Call Function Return Type OID Caching Problem

Поиск
Список
Период
Сортировка
От Feng Chen
Тема Re: Postgres Stored Procedure Call Function Return Type OID Caching Problem
Дата
Msg-id 0D1719326D64BD4E9F92A0C1202376780192A325@eserv.covergence.com
обсуждение исходный текст
Ответ на Postgres Stored Procedure Call Function Return Type OID Caching Problem  ("Feng Chen" <fchen@covergence.com>)
Список pgsql-odbc
Hi Tom,

Thanks for your comment!

We do use EXECUTE in the functions for all the sql commands, things like

         EXECUTE 'CREATE TEMP TABLE temp_foo
         (
             "foo" text
         ) ';

      select_statement = '...';
        EXECUTE select_statement' ;

      insert_statement = '...';
        EXECUTE select_statement' ;

However, there is one temp table we do not explicitly drop in one
function for technical reasons. And we have another function that uses a
different temp table we drop at the end of that function. However, we
did not use the cascade keyword when dropping it.

Could the usage of either or both of the temp tables cause this return
type mismatch problem? And would dropping the temp tables every time
inside the function with the cascade keyword fix the problem?

Thank you!

FC


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Wednesday, January 24, 2007 5:16 PM
To: Feng Chen
Cc: imad; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Postgres Stored Procedure Call Function Return Type
OID Caching Problem

"Feng Chen" <fchen@covergence.com> writes:
> The problem is that I should not have to and cannot re-load the
> functions every now and then. Why would the type id change and the
> function still references to the old type id thus fails to get the
right
> results?

It's not possible in any modern version of PG to drop the function's
return type without dropping the function too.  I suspect the problem
is not with the return type at all, but with some table or other type
referenced within the function body.  Currently the only real solution
to that is to use EXECUTE for every SQL command that touches a transient
object, so that plpgsql won't try to cache a plan for the command.

            regards, tom lane

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres Stored Procedure Call Function Return Type OID Caching Problem
Следующее
От:
Дата:
Сообщение: [ psqlodbc-Bugs-1001172 ] Problem with ADO.RecordCount