From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ben Snaidero <bensnaidero@geotab.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Error during analyze after upgrade from 10.10 -> 11.4
Date: Mon, 23 Sep 2019 15:06:38 -0400
Message-ID: <16059.1569265598@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEPE5bO7voDWdLx=_Az9St4S4aC9toGocNN7PqPC7g63yKaHEw@mail.gmail.com>
References: <CAEPE5bO7voDWdLx=_Az9St4S4aC9toGocNN7PqPC7g63yKaHEw@mail.gmail.com>
Ben Snaidero <bensnaidero@geotab.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, bensnaidero@geotab.com
Subject: Re: Error during analyze after upgrade from 10.10 -> 11.4
In-Reply-To: <16059.1569265598@sss.pgh.pa.us>
References: <CAEPE5bO7voDWdLx=_Az9St4S4aC9toGocNN7PqPC7g63yKaHEw@mail.gmail.com> <16059.1569265598@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox