RE: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.

From: Jean-Marc Lessard <Jean-Marc(dot)Lessard(at)ultra-ft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.
Date: 2018-12-14 21:57:41
Message-ID: 8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I think I got it. Looks like related to pgaudit.

I did an initdb and run the test case without issue

As soon as l add pgaudit and create the extension, the error is raised
You do not need any FK in the test schema to reproduce the problem.

shared_preload_libraries = 'pgaudit'
pgaudit.log = 'all'
pgaudit.log_catalog = on
pgaudit.log_parameter = on

pgaudit 1.3 is installed (the PG11 compatible version)

select * from pg_extension;
extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
--------------------+----------+--------------+----------------+------------+-----------+--------------
plpgsql | 10 | 11 | f | 1.0 | (NULL) | (NULL)
adminpack | 10 | 11 | f | 2.0 | (NULL) | (NULL)
lo | 10 | 16394 | t | 1.1 | (NULL) | (NULL)
postgres_fdw | 10 | 16394 | t | 1.0 | (NULL) | (NULL)
pg_stat_statements | 10 | 16394 | t | 1.6 | (NULL) | (NULL)
pgrowlocks | 10 | 16394 | t | 1.2 | (NULL) | (NULL)
pgstattuple | 10 | 16394 | t | 1.5 | (NULL) | (NULL)
pg_freespacemap | 10 | 16394 | t | 1.2 | (NULL) | (NULL)
pgaudit | 10 | 16432 | t | 1.3 | (NULL) | (NULL)
(9 rows)

You should now be able to reproduce it.

Regards, JML

Jean-Marc Lessard
Administrateur de base de données / Database Administrator
Ultra Electronics Forensic Technology Inc.
T +1 514 489 4247 x4164
www.ultra-forensictechnology.com<http://www.ultra-forensictechnology.com>

-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Friday, December 14, 2018 3:27 PM
To: Jean-Marc Lessard <Jean-Marc(dot)Lessard(at)ultra-ft(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)org> writes:
> I got an "ERROR: cache lookup failed for type 2" when a function is
> run for the first time in a session.

That certainly looks like a bug, but I can't replicate it from the given instructions.

The function seems to expect that the current schema contains some foreign key constraints, which it doesn't when I just follow your script exactly. However, even if I add a few more tables with foreign-key relationships, all seems well.

Please provide a complete script that will reproduce the problem starting from an empty database. Also, have you got any extensions loaded, or any unusual configuration settings?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hugh Ranalli 2018-12-14 22:42:05 Re: BUG #15548: Unaccent does not remove combining diacritical characters
Previous Message Tom Lane 2018-12-14 20:26:30 Re: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.