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 1qyEjH-0071Kd-7J for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 17:10:07 +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 1qyEjE-007v08-EE for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 17:10:04 +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 1qyEjE-007uzZ-2A for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 17:10:04 +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 1qyEjB-003TSp-HQ for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 17:10:02 +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=tsEWxv1JguimAtYJRvXX0q3iwpcjKh++XOS+/egtaZ8=; b=jtsxCtjIM9OeQEJXhbQL7fXytv 9Xmiz2qTyM3/9ykv6zYUz/vjuw8xGep/1RKauNaSuvI88Zl82bviZ9RaTpNj1MkWXUSpot4GycOrS LN+0I6YMJccppl1mReDc039eIIfpZES9bfSjlCJaOAYPSjTh7bEoIrjbaCD4MnosYb9mfqrEwEQ/l H/3s+6SFYcmsDqkbCw2iS0uXhqhRK/L/iGf8oNqKoOj0r8Iuv4scv55TqXdw2iDkp+GANDJzLgM8f KGNhrfp93tNYn456tUTZHxp287FU/Hr8w8aQV6yMa7+sHLawloXTjM30jzHeqC6ThBaHEb11s5aYK Ctryc4GQ==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qyEj9-0090Qv-0H; Wed, 01 Nov 2023 13:09:59 -0400 Date: Wed, 1 Nov 2023 13:09:59 -0400 From: Bruce Momjian To: Laurenz Albe Cc: Jordi =?utf-8?Q?Guti=C3=A9rrez?= Hermoso , pgsql-docs@lists.postgresql.org Subject: Re: Document target_role param of ALTER DEFAULT PRIVILEGES Message-ID: References: <72652d72e1816bfc3c05d40f9e0e0373d07823c8.camel@octave.org> <293903c1f00f9b5053c0aa388ddc2850ae537f33.camel@cybertec.at> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9IbS4Egp8PUeJ94h" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <293903c1f00f9b5053c0aa388ddc2850ae537f33.camel@cybertec.at> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9IbS4Egp8PUeJ94h Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Feb 18, 2021 at 08:16:13AM +0100, Laurenz Albe wrote: > On Wed, 2021-02-17 at 15:08 -0500, Jordi GutiƩrrez Hermoso wrote: > > I just had a confusing moment trying to figure out why my roles > > weren't creating tables the way I was expecting them to. I didn't > > understand what the `target_role` parameter did. No matter how I try > > to read this page, I can't see an explanation for that parameter: > > > > https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html > > > > I propose an explanation like the following be added to the > > `target_role` parameter: > > > > This is the role that will create objects with altered default > > privileges. Note that changes in default privileges aren't > > inherited, so altering the default privileges of created objects > > for a parent role will not change the default privileges of > > objects created by inherited roles. > > +1. I cannot count the number of times I have seen people confused by that. > > Suggested patch attached. I see how people can be confused. I wrote this patch, which I think is simpler than the previously posted one. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --9IbS4Egp8PUeJ94h 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 index f1d54f5aa3..8a6006188d 100644 --- a/doc/src/sgml/ref/alter_default_privileges.sgml +++ b/doc/src/sgml/ref/alter_default_privileges.sgml @@ -137,7 +137,11 @@ REVOKE [ GRANT OPTION FOR ] The name of an existing role of which the current role is a member. - If FOR ROLE is omitted, the current role is assumed. + 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. --9IbS4Egp8PUeJ94h--