Re: "cache lookup failed for type ####" when running unit tests - Mailing list pgsql-general

From Tom Lane
Subject Re: "cache lookup failed for type ####" when running unit tests
Date
Msg-id 12692.1535308790@sss.pgh.pa.us
Whole thread Raw
In response to "cache lookup failed for type ####" when running unit tests  (Wilhansen Li <willi.t1@gmail.com>)
Responses Re: "cache lookup failed for type ####" when running unit tests
List pgsql-general
Wilhansen Li <willi.t1@gmail.com> 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


pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: pg_dump order of operation
Next
From: Tom Lane
Date:
Subject: Re: pg_dump order of operation