Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4F26D9FB39C for ; Wed, 24 Jan 2007 18:16:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 47595-05 for ; Wed, 24 Jan 2007 18:15:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B2FFC9FB1D2 for ; Wed, 24 Jan 2007 18:16:01 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l0OMFvsL009955; Wed, 24 Jan 2007 17:15:57 -0500 (EST) To: "Feng Chen" cc: "imad" , pgsql-odbc@postgresql.org Subject: Re: Postgres Stored Procedure Call Function Return Type OID Caching Problem In-reply-to: <0D1719326D64BD4E9F92A0C1202376780192A28C@eserv.covergence.com> References: <0D1719326D64BD4E9F92A0C1202376780192A257@eserv.covergence.com> <1f30b80c0701241150h597ae274wb10265fa29921386@mail.gmail.com> <0D1719326D64BD4E9F92A0C1202376780192A28C@eserv.covergence.com> Comments: In-reply-to "Feng Chen" message dated "Wed, 24 Jan 2007 15:15:38 -0500" Date: Wed, 24 Jan 2007 17:15:56 -0500 Message-ID: <9954.1169676956@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/60 X-Sequence-Number: 8599 "Feng Chen" 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