Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJ2zD-0005vS-4O for pgsql-general@arkaria.postgresql.org; Sun, 07 Mar 2021 23:38:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJ2zC-0002Vw-2Q for pgsql-general@arkaria.postgresql.org; Sun, 07 Mar 2021 23:38:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJ2zB-0002Vp-RV for pgsql-general@lists.postgresql.org; Sun, 07 Mar 2021 23:38:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJ2z9-0001Rw-Sw for pgsql-general@lists.postgresql.org; Sun, 07 Mar 2021 23:38:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 127Ncseb1686761; Sun, 7 Mar 2021 18:38:54 -0500 From: Tom Lane To: Paul McGarry cc: pgsql-general@lists.postgresql.org Subject: Re: Vacuuming by non owner/super users? In-reply-to: References: Comments: In-reply-to Paul McGarry message dated "Mon, 08 Mar 2021 10:14:01 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1686759.1615160334.1@sss.pgh.pa.us> Date: Sun, 07 Mar 2021 18:38:54 -0500 Message-ID: <1686760.1615160334@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Paul McGarry 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 VACUUM 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