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 1qyjM1-00Ac2T-T7 for pgsql-docs@arkaria.postgresql.org; Fri, 03 Nov 2023 01:52:09 +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 1qyjLz-00GRgl-N3 for pgsql-docs@arkaria.postgresql.org; Fri, 03 Nov 2023 01:52:07 +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 1qyjLz-00GRgR-FK for pgsql-docs@lists.postgresql.org; Fri, 03 Nov 2023 01:52:07 +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 1qyjLs-003gtG-IJ for pgsql-docs@lists.postgresql.org; Fri, 03 Nov 2023 01:52:06 +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=25J0Mh1SgYSXXYm/GLBsWdS0/IN+iKzxcXePxjPVjdM=; b=4iOiQU5xvPE7tFTTa/GKvGZwjl 3G1wf1xWfaEHmr2shEayfO61O6wtg86XGklxxrjO6AeLWEvZa/VV2jBO334rFhxaT+DtFgJmQGTrM MwMMwjcmaBNiM9bzHMvO0U+lfwy64RVPQj9RqMcGLPELoduzzrNSIR0+V5u39UmUYo4W7ABBZQSnV 6qpslURHJC/Hh7xFXO6TF8Ou7i7kp9uFL0E51SpuDBNW8VqchX5PYHQ0cHmW7em4Y2QpfA8+QQFSb ZQVDKgz701X3QotALTAejtjaRvhq/wLg2lGXmqiOrjsxESFXyQJ1FNkS9apqKcurj1fiZt9ayvndJ im0104Fw==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qyjLq-00DEtg-0i; Thu, 02 Nov 2023 21:51:58 -0400 Date: Thu, 2 Nov 2023 21:51:58 -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: text/plain; charset=utf-8 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 On Wed, Nov 1, 2023 at 09:31:52PM +0100, Laurenz Albe wrote: > On Wed, 2023-11-01 at 13:09 -0400, Bruce Momjian wrote: > > 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. > > Oh, I had forgotten about this patch. I like your version better. > > There is another patch in the current commitfest that addresses a similar > problem, triggered by another complaint: > https://commitfest.postgresql.org/45/4633/ > > That patch does not cover role membership. Perhaps you could adopt that > patch and merge the information from your patch into it. Agreed. I found this doc report from 2020 with the same confusion about what target_role means: https://www.postgresql.org/message-id/flat/160003085417.31338.6391977653235501273%40wrigleys.postgresql.org I will apply my patch tomorrow/Friday and then work on the commitfest one. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.