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 17473.1550503550@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> 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
> 2019-02-18 05:30:36 GMT [40267]: [7-1] db=,user= LOG:  00000: autovacuum
> launcher process (PID 40378) exited with exit code 1

Hm.  So something is trying to access pg_class (perhaps only on the way to
reading something else) inside the autovacuum launcher, which it cannot
do because the launcher isn't connected to any specific database.

I have not heard of such behavior in core Postgres, which makes me think
that the problem is in one of your extensions.  You mention

> shared_preload_libraries = 'pg_stat_statements, timescaledb,
> pg_wait_sampling, repmgr, auto_explain'

I'd suggest removing entries from shared_preload_libraries one at a
time to see if the problem stops occurring.  (Obviously, you have to
restart the postmaster each time you change the list.)  Once you've
found the culprit, closer analysis would be possible.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #15640: FATAL: XX000: cannot read pg_class without havingselected a database
Next
From: Stephen Frost
Date:
Subject: Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFSdestination throws fsync error at end of backup