Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database
Date
Msg-id 31217.1550511163@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15640: FATAL: XX000: cannot read pg_class without havingselected a database  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: BUG #15640: FATAL: XX000: cannot read pg_class without havingselected a database  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Feb-18, Andres Freund wrote:
>> My initial guess would be that one of the extensions registered a
>> relcache callback, and does catalog accesses in an unconditional manner.

> Hmm but why is extension code running in autovacuum launcher?

Anything registered in shared_preload_libraries is going to be active
in every process.  I don't particularly believe Andres' theory that
CacheRegisterRelcacheCallback is involved, but it seems very likely
that one of these extensions has hooked into some code path that the
launcher can traverse, and it's doing more than is safe there.

If this weren't a production database, I'd suggest changing that error
to a PANIC so we could get a stack trace.  That would almost certainly
pinpoint the culprit.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Maksim Milyutin
Date:
Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectlygenerates WAL segment created during backup
Next
From: Andres Freund
Date:
Subject: Re: BUG #15640: FATAL: XX000: cannot read pg_class without havingselected a database