From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wilhansen Li <willi.t1@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: "cache lookup failed for type ####" when running unit tests
Date: Sun, 26 Aug 2018 14:39:50 -0400
Message-ID: <12692.1535308790@sss.pgh.pa.us> (raw)
In-Reply-To: <CAD57gzDFwMALkHx9FSNS-oO6hc+GaES=++ufKuV4eGTrtyVD-w@mail.gmail.com>
References: <CAD57gzDFwMALkHx9FSNS-oO6hc+GaES=++ufKuV4eGTrtyVD-w@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, willi.t1@gmail.com
Subject: Re: "cache lookup failed for type ####" when running unit tests
In-Reply-To: <12692.1535308790@sss.pgh.pa.us>
References: <CAD57gzDFwMALkHx9FSNS-oO6hc+GaES=++ufKuV4eGTrtyVD-w@mail.gmail.com> <12692.1535308790@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox