Hi there,
I recently upgraded the PostgresSQL from 12.8 to 13.8. The upgrade worked as far as I can tell but at the end I got the following error:
Error running PGOPTIONS='-c statement_timeout=0' /opt/gitlab/embedded/postgresql/13/bin/vacuumdb -j2 --all --analyze-in-stages -h -p 5432
STDOUT:
STDERR: vacuumdb: error: cannot vacuum all databases and a specific one at the same time
Please check the output, and rerun the command as root or with sudo if needed:
sudo su - gitlab-psql -c "PGOPTIONS='-c statement_timeout=0' /opt/gitlab/embedded/postgresql/13/bin/vacuumdb -j2 --all --analyze-in-stages -h -p 5432"
Running the command with sudo returns the error again:
vacuumdb: error: cannot vacuum all databases and a specific one at the same time
Following the guide on Database settings | GitLab I ran the following two commands:
Use gitlab-psql
to determine whether ANALYZE
should be run manually:
sudo gitlab-psql -c "SELECT relname, last_analyze, last_autoanalyze FROM pg_stat_user_tables WHERE last_analyze IS NULL AND last_autoanalyze IS NULL;"
You can run ANALYZE
manually if the query above returned any rows:
sudo gitlab-psql -c 'SET statement_timeout = 0; ANALYZE VERBOSE;'
Still the error ``vacuumdb: error: cannot vacuum all databases and a specific one at the same time
persists.
What are my next steps? Can anyone give me a hint on how to troubleshoot further? Thank you for reading.