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 1r01xM-002mR7-DT for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Nov 2023 15:56:04 +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 1r01xJ-00Gzks-NA for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Nov 2023 15:56:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r01xJ-00Gzkj-8r for pgsql-hackers@lists.postgresql.org; Mon, 06 Nov 2023 15:56:01 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r01xG-004Fxd-Cm for pgsql-hackers@lists.postgresql.org; Mon, 06 Nov 2023 15:55:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=90u5SY6Iqsi6UKhJkHwTQeTUZaLMrmaI5xX33DGazH0=; b=wzA/wvejes2iPAYEYjI+CbR9DK q0dq0NaYEk0T7YA2z1OBk5xWSScVvsKjhIYGzQFabviqSIt+sZSlARqCDq5+mh17V1Nm6hFHtFbms TVYahEvH2Fhhj/D045oSnMi5sXUg/UQ4zdw2o0BcfTk+FThV3HKKn7Q2agJGsjvVWpeJVtMOE35z6 llxQTSbeZdfpi2mi9WbUd3F2NsqTPW6BdzyUzdasLHpS1VgQDstlyyoDdlFS+GcCs4oRF/UTYlRGQ wUo/kKDWh8xq3JE+b/I9qzoKrQxAkWyuzEnfIxOkH4SI9NspTRmuPS8YwnyepyTdA8HkHOn2vlg3U RX5DCS3Q==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1r01xD-008w2s-0z; Mon, 06 Nov 2023 10:55:55 -0500 Date: Mon, 6 Nov 2023 10:55:55 -0500 From: Bruce Momjian To: Laurenz Albe Cc: Michael Banck , David Burns , pgsql-hackers@lists.postgresql.org Subject: Re: Version 14/15 documentation Section "Alter Default Privileges" Message-ID: References: <653b841d.a70a0220.17f72.2c12@mx.google.com> <7de5f33f49a91d7b30b8c01fe46fc280713ebae1.camel@cybertec.at> <653cce08.050a0220.a10fb.7878@mx.google.com> <244e0f9e3300f165ff578302e942fa3145dedfc7.camel@cybertec.at> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pZBDanP6HC8LB2Jz" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pZBDanP6HC8LB2Jz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Nov 6, 2023 at 09:44:14AM +0100, Laurenz Albe wrote: > On Sat, 2023-11-04 at 21:14 -0400, Bruce Momjian wrote: > > > It is not the role that is modified.  Perhaps: > > > > > >    [...]; if omitted, the current role is used. > > > > Sure, attached.  Here is the issue I have though, we are really not > > changing default privileges for objects created in the future, we are > > changing the role _now_ so future objects will have different default > > privileges, right?  I think wording like the above is kind of odd. > > I see what you mean. The alternative is to be precise, at the risk of > repeating ourselves: > > if omitted, default privileges will be changed for objects created by > the current role. Okay, I think I have good wording for this. I didn't like the wording of other roles, so I restructured that in the attached patch too. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --pZBDanP6HC8LB2Jz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="role.diff" diff --git a/doc/src/sgml/ref/alter_default_privileges.sgml b/doc/src/sgml/ref/alter_default_privileges.sgml new file mode 100644 index 8a60061..a868779 *** a/doc/src/sgml/ref/alter_default_privileges.sgml --- b/doc/src/sgml/ref/alter_default_privileges.sgml *************** REVOKE [ GRANT OPTION FOR ] *** 90,112 **** ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the future. (It does not ! affect privileges assigned to already-existing objects.) Currently, ! only the privileges for schemas, tables (including views and foreign ! tables), sequences, functions, and types (including domains) can be ! altered. For this command, functions include aggregates and procedures. ! The words FUNCTIONS and ROUTINES are ! equivalent in this command. (ROUTINES is preferred ! going forward as the standard term for functions and procedures taken ! together. In earlier PostgreSQL releases, only the ! word FUNCTIONS was allowed. It is not possible to set ! default privileges for functions and procedures separately.) ! You can change default privileges only for objects that will be created by ! yourself or by roles that you are a member of. The privileges can be set ! globally (i.e., for all objects created in the current database), ! or just for objects created in specified schemas. --- 90,113 ---- ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the future. (It does not ! affect privileges assigned to already-existing objects.) Privileges can be ! set globally (i.e., for all objects created in the current database), or ! just for objects created in specified schemas. ! Default privileges apply only to the active role; the default ! privileges of member roles have no affect on object permissions. ! SET ROLE can be used to change the active user and ! apply their default privileges. ! ! ! ! As a non-superuser, you can change your own default privileges and ! the defauls of roles that you are a member of. There is no way to ! set default privileges for a role and all its members with a single ! command; individual ALTER DEFAULT PRIVILEGES ! commands must be run to achieve this. *************** REVOKE [ GRANT OPTION FOR ] *** 119,124 **** --- 120,138 ---- + Currently, + only the privileges for schemas, tables (including views and foreign + tables), sequences, functions, and types (including domains) can be + altered. For this command, functions include aggregates and procedures. + The words FUNCTIONS and ROUTINES are + equivalent in this command. (ROUTINES is preferred + going forward as the standard term for functions and procedures taken + together. In earlier PostgreSQL releases, only the + word FUNCTIONS was allowed. It is not possible to set + default privileges for functions and procedures separately.) + + + Default privileges that are specified per-schema are added to whatever the global default privileges are for the particular object type. This means you cannot revoke privileges per-schema if they are granted *************** REVOKE [ GRANT OPTION FOR ] *** 136,147 **** target_role ! The name of an existing role of which the current role is a member. ! Default access privileges are not inherited, so member roles ! must use SET ROLE to access these privileges, ! or ALTER DEFAULT PRIVILEGES must be run for ! each member role. If FOR ROLE is omitted, ! the current role is assumed. --- 150,158 ---- target_role ! Change default privileges for objects created by the ! target_role, or the current ! role if unspecified. --pZBDanP6HC8LB2Jz--