How do I grant PostgreSQL superuser access to vacuum tables?

by Teflon Ted   Last Updated May 15, 2018 19:06 PM

My logs are constantly filling up with these messages for hundreds of tables:

WARNING:  skipping "some_table_name" --- only table or database owner can analyze it

How do I perform any the following and/or resolve this?

  1. Determine in which database(s) these tables reside? Would be nice if the warning included that information.
  2. Grant the PostgreSQL superuser access to vacuum these tables
  3. Disable these warnings in the log file

Side note: none of the log file rotation, truncation, size/date limits settings are working either but I'll save that for a separate post.



Answers 2


It sounds like you revoked superuser privileges from the cluster's founding user. Don't do that. Log in as your remaining superuser, and grant superuser privileges back to the founding user. If you have no remaining superusers, then you need to shut down the server, start it up in single-user mode, and regrant superuser privs.

The founding user is the username specified to initdb's -U argument when the database was created, or if that argument was not provided, then it is the name of the OS user who ran the initdb. This is most often postgres.

jjanes
jjanes
February 14, 2017 16:46 PM

You need to restore postgres' rights to superuser:

ALTER USER postgres WITH SUPERUSER;
Christian
Christian
May 15, 2018 18:59 PM

Related Questions



Postgres long autovacuum halting database

Updated December 31, 2016 08:02 AM

Autovacuum in Postgresql 9.5 database

Updated November 17, 2017 10:06 AM