Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qazUe-00AsNf-VD for pgsql-general@arkaria.postgresql.org; Tue, 29 Aug 2023 14:14:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qazUd-007vYi-FS for pgsql-general@arkaria.postgresql.org; Tue, 29 Aug 2023 14:14:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qazUd-007vYa-3o for pgsql-general@lists.postgresql.org; Tue, 29 Aug 2023 14:14:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qazUZ-001kgb-Cm for pgsql-general@lists.postgresql.org; Tue, 29 Aug 2023 14:14:54 +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 37TEEjAA1006398; Tue, 29 Aug 2023 10:14:45 -0400 From: Tom Lane To: Erik Wienhold cc: Stuart McGraw , pgsql-general@lists.postgresql.org Subject: Re: Restoring default privileges on objects In-reply-to: <1166048641.281962.1693308151542@office.mailbox.org> References: <96d6885a-5e25-9ae8-4a1a-d7e557a5fe9c@mtneva.com> <1166048641.281962.1693308151542@office.mailbox.org> Comments: In-reply-to Erik Wienhold message dated "Tue, 29 Aug 2023 13:22:31 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1006396.1693318485.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Aug 2023 10:14:45 -0400 Message-ID: <1006397.1693318485@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Erik Wienhold writes: > On 29/08/2023 03:23 CEST Stuart McGraw wrote: >> If I've done a GRANT or REVOKE on some of the tables, how do I restore >> the default privileges so that the =E2=80=9CAccess privileges=E2=80=9D = appears empty >> again? I re-granted what I think are the default privileges but the >> "Access privileges" column for that table contains "user1=3DarwdDxt/use= r1" >> rather than being blank. This is Postgresql-14. > Yes, "user1=3DarwdDxt/user1" matches the default privileges if user1 is = the table > owner. Right. There is no (supported) way to cause the ACL entry to go back to null. It starts life that way as an ancient hack to save a step during object creation. But the moment you do anything to the object's privileges, the NULL is replaced by an explicit representation of the default privileges, which is then modified per whatever command you are giving. After that the privileges will always be explicit. There's been occasional discussion of changing this behavior, but it'd take work and it'd likely add about as much surprise as it removes. People have been used to this quirk for a long time. regards, tom lane