Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftzxB-0004ta-PN for pgsql-general@arkaria.postgresql.org; Sun, 26 Aug 2018 18:40:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ftzx9-0007Gc-Tw for pgsql-general@arkaria.postgresql.org; Sun, 26 Aug 2018 18:39:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftzx9-0007GV-BW for pgsql-general@lists.postgresql.org; Sun, 26 Aug 2018 18:39:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftzx2-00007r-OM for pgsql-general@postgresql.org; Sun, 26 Aug 2018 18:39:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7QIdo1c012693; Sun, 26 Aug 2018 14:39:50 -0400 From: Tom Lane To: Wilhansen Li cc: pgsql-general@postgresql.org Subject: Re: "cache lookup failed for type ####" when running unit tests In-reply-to: References: Comments: In-reply-to Wilhansen Li message dated "Mon, 27 Aug 2018 01:40:19 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12691.1535308790.1@sss.pgh.pa.us> Date: Sun, 26 Aug 2018 14:39:50 -0400 Message-ID: <12692.1535308790@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Wilhansen Li writes: > I have a web application with a bunch of unit tests which involve accessing > a PostgreSQL database. My schema contains composite types and stored > procedures. > When running the tests, I'm getting a > "com.impossibl.postgres.jdbc.PGSQLSimpleException: cache lookup failed for > type 64790" when trying to call a stored procedure whose parameter is an > array of a composite type (e.g. "create function foo(param comp_type[]") > The funny thing is, when I run the specific test in isolation the problem > disappears. Hard to be sure when you haven't shown us any code, but I suspect the issue boils down to caching of type data inside a plpgsql function that *uses* some type you dropped and recreated, without having any parameter of that type. (If it did have such a parameter, you'd have been forced to drop and recreate the function, eliminating the cached info. That doesn't apply though to internal uses, such as a variable of the type.) Another possibility, if you're trying to pass an argument of such a type directly from the client side, is that the JDBC driver is caching data about that type name and doesn't realize you've replaced it with some new definition. regards, tom lane