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 1iCTfZ-0002ws-Ik for pgsql-general@arkaria.postgresql.org; Mon, 23 Sep 2019 19:06:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iCTfY-0005a8-DY for pgsql-general@arkaria.postgresql.org; Mon, 23 Sep 2019 19:06:44 +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 1iCTfY-0005Y2-0g for pgsql-general@lists.postgresql.org; Mon, 23 Sep 2019 19:06:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iCTfV-0005CK-LU for pgsql-general@postgresql.org; Mon, 23 Sep 2019 19:06:42 +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 x8NJ6cV4016060; Mon, 23 Sep 2019 15:06:38 -0400 From: Tom Lane To: Ben Snaidero cc: pgsql-general Subject: Re: Error during analyze after upgrade from 10.10 -> 11.4 In-reply-to: References: Comments: In-reply-to Ben Snaidero message dated "Mon, 23 Sep 2019 14:40:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16058.1569265598.1@sss.pgh.pa.us> Date: Mon, 23 Sep 2019 15:06:38 -0400 Message-ID: <16059.1569265598@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ben Snaidero writes: > After upgrade completes when running "vacuumdb -p 5432 -U postgres -a -Z > --analyze-in-stages" I get the following error: > * vacuumdb: processing database "#DBNAME#": Generating minimal optimizer > statistics (1 target) vacuumdb: vacuuming of database "#DBNAME#" failed: > ERROR: could not access status of transaction 6095 DETAIL: Could not > open file "pg_xact/0000": No such file or directory.* > After logging into the database using psql and running "VACUUM FULL > #table#" for each table I can see it's an issue with pg_statistic If it's only pg_statistic then you're in luck, because all the data in that is rebuildable. You can try "delete from pg_statistic", and then "vacuum full pg_statistic". I'm not sure that will work though, it may hit the same problem. If so, you need a bigger hammer: "TRUNCATE pg_statistic" will fix it, but you'll need to stop the server and restart with allow_system_table_mods enabled to be allowed to do that. (Turn allow_system_table_mods back off afterwards!) Once you've got an empty pg_statistic, run "ANALYZE;" (as superuser) to rebuild all the stats. Hard to tell what the underlying issue is here --- perhaps pg_upgrade messed up, but it would take some detailed investigation to find out. regards, tom lane