Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvknz-0008E1-B8 for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Feb 2019 15:26:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvknx-00024l-49 for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Feb 2019 15:26:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvknw-00021n-QK for pgsql-bugs@lists.postgresql.org; Mon, 18 Feb 2019 15:26:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvknp-0000qZ-TP for pgsql-bugs@lists.postgresql.org; Mon, 18 Feb 2019 15:25:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1IFPoRl017474; Mon, 18 Feb 2019 10:25:50 -0500 From: Tom Lane To: m.kiianov@rtk-dc.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15640: FATAL: XX000: cannot read pg_class without having selected a database In-reply-to: <15640-58e01e10b362cc7f@postgresql.org> References: <15640-58e01e10b362cc7f@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 18 Feb 2019 09:51:12 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17472.1550503550.1@sss.pgh.pa.us> Date: Mon, 18 Feb 2019 10:25:50 -0500 Message-ID: <17473.1550503550@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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