pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Marc Lessard <Jean-Marc.Lessard@ultra-ft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.
Date: Fri, 14 Dec 2018 21:57:41 +0000
Message-ID: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com> (raw)
In-Reply-To: <23950.1544819190@sss.pgh.pa.us>
References: <15553-a9453b116f1e3c75@postgresql.org>
	<23950.1544819190@sss.pgh.pa.us>

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@sss.pgh.pa.us>
Sent: Friday, December 14, 2018 3:27 PM
To: Jean-Marc Lessard <Jean-Marc.Lessard@ultra-ft.com>
Cc: pgsql-bugs@lists.postgresql.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@postgresql.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

view thread (5+ messages)  latest in thread

Message-ID: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com>
Permalink:  ../8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com/
Also on:    postgresql.org/message-id/8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com

 · 

reply

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-bugs@postgresql.org
  Cc: Jean-Marc.Lessard@ultra-ft.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #15553: "ERROR: cache lookup failed for type 2" with a function the first time it run.
  In-Reply-To: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com>
  References: <15553-a9453b116f1e3c75@postgresql.org> <23950.1544819190@sss.pgh.pa.us> <8FC5F25FF3EC4744ADFCF20CBA3F44BE016813D13D@SRV-CAMTL-EXCH2.Forensictech.com>

* 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