Vacuuming by non owner/super users?

Started by Paul McGarryabout 5 years ago2 messagesgeneral
Jump to latest
#1Paul McGarry
paul@paulmcgarry.com

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."

Where the "ordinarily" seems to imply there might be some non-ordinary way
of performing a vacuum?
(If it really is just table owner or super user, then the sentence would be
clearer without the "ordinarily").

I am trying to split up DB maintenance, ie would like to give permission to
vacuum DB/tables without giving them full rights to do other stuff on the
tables.

Thanks for any advice.

Paul

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Paul McGarry (#1)
Re: Vacuuming by non owner/super users?

Paul McGarry <paul@paulmcgarry.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