Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, m(dot)kiianov(at)rtk-dc(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database
Date: 2019-02-18 16:42:47
Message-ID: 20190218164247.5jvu7gotnz4sw4jn@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2019-02-18 11:29:49 -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > On 2019-Feb-18, PG Bug reporting form wrote:
> >> 2019-02-18 05:30:36 GMT [40378]: [2-1] db=,user= FATAL: XX000: cannot read pg_class without having selected a database
> >> 2019-02-18 05:30:36 GMT [40378]: [3-1] db=,user= LOCATION: ScanPgRelation, relcache.c:314
>
> > Hmm, I wonder if this is a bug introduced in 6a46aba1cd6d (in 9.6.10)
> > that only hits autovacuum launcher after a relcache init removal at just
> > the wrong time, or something like that?

I don't immediately see how that'd be the culprit - we'd processed
sinvals in some cases before that change too. I'm inclined to think
Tom's guess is the right one, but ...

My initial guess would be that one of the extensions registered a
relcache callback, and does catalog accesses in an unconditional manner.

> I think/hope that the launcher isn't connected to sinval, either.

Hm, I don't think that's true? The launcher does InitPostgres() and
everything (albeit without a database). And it needs to process
relmapper updates, otherwise it can't access pg_database. And that's
accessed via a normal heap_open().

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2019-02-18 16:44:12 Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database
Previous Message Tom Lane 2019-02-18 16:29:49 Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database