"cache lookup failed for type ####" when running unit tests

From: Wilhansen Li <willi(dot)t1(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: "cache lookup failed for type ####" when running unit tests
Date: 2018-08-26 17:40:19
Message-ID: CAD57gzDFwMALkHx9FSNS-oO6hc+GaES=++ufKuV4eGTrtyVD-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

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.

Note that the tests are grouped into fixtures and each fixture resets the
database when run (it drops all tables, types, and functions then recreates
them) and they are run serially (so it's not a parallel execution problem).
Also, each test is run inside a transaction that's set to rollback after
the test is finished in order to reduce the amount database resets.

I'm having problems understanding what's causing the problem but i suspect
that the rapid database resets paired with transaction use (abuse?) are the
ones causing it. I've tried delays but those don't fix the problems.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2018-08-26 18:18:35 Re: pg_dump order of operation
Previous Message Tom Lane 2018-08-26 15:24:10 Re: pg_dump order of operation