Re: Vacuuming by non owner/super users?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul McGarry <paul(at)paulmcgarry(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Vacuuming by non owner/super users?
Date: 2021-03-07 23:38:54
Message-ID: 1686760.1615160334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul McGarry <paul(at)paulmcgarry(dot)com> writes:
> Is it possible for a non-owner or non super user to be given permission to
> vacuum tables in the DB?
> My initial thought is no, but the documentation says:
> "To vacuum a table, one must ordinarily be the table's owner or a
> superuser."

The full quote is

To vacuum a table, one must ordinarily be the table's owner or a
superuser. However, database owners are allowed to
vacuum all tables in their databases, except shared catalogs.
(The restriction for shared catalogs means that a true database-wide
<command>VACUUM</command> can only be performed by a superuser.)

and as far as I can see, the permissions check in vacuum.c implements that
exactly.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Abdul Qoyyuum 2021-03-08 01:34:52 Is it normal to have too many idle processes in postgresql cluster?
Previous Message Michael Paquier 2021-03-07 23:38:02 Re: Log files polluted with permission denied error messages after every 10 seconds