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 1qyHsi-007OEU-96 for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 20:32: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 1qyHsg-008li4-RR for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 20:32:02 +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 1qyHsg-008lht-FE for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 20:32:02 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qyHsZ-003UwH-LR for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 20:32:01 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32f78dcf036so785840f8f.0 for ; Wed, 01 Nov 2023 13:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698870713; x=1699475513; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=v6La0oIzKfbjUusYdXF8sfzEF0Pb+xCjDhkdtyKRl4Y=; b=3PYLXUWP4BQcr/DPU7idM6Dva981JRxOhPcy3FsKZDi7lzDxhOKRnvWdolW1olJkXR LQp+2+ShCxvhlQeI8U64yhQqKvyZmOyBywvyRgvOvStjNQIsp7F8rc+uhGa4UNEVLZB6 QS/G3G2HuVN3sYQl2/CIyY5D81vTaAB3W3aENkr9SpHHvMM0EgE62BBhKZ1ehFHm17mn oEBM8i6E3sAlsDtZuSYGpVyKxISxol+Qv2uDPAXhNRuiBinyjoUycF8/r+QSwKTIce/i 2PlcTGLTNAIPQs/kDF9T7H956TjvY3TS6kyIinWUucslRPgfcqcyjHEbfwxiECDxYkUk lxoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698870713; x=1699475513; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=v6La0oIzKfbjUusYdXF8sfzEF0Pb+xCjDhkdtyKRl4Y=; b=Q5+Umvye7bZ6m8ukHUqDuJ/wA9wqwIohcdSVi9Cpn70+i5q2ZawB1cfS57yUdrswG1 ggVFCG9gt5Qen5t3+5Boq7vfx6y/cd/oAry2kY4/ix+/IEr2aPANtcTyGPHzmDSIu08O FVbICIdU726tW+buBlgU8bUm50rT5yPnDJBxDEqZqqfMzh9VeJO4B9xkzc0CPl7u3iU5 pMZh++w9Vz/9w8fgI2JpKCT1clgHUMv9mwFhnkVn+UBBIyBBni0NbGhusorv7beIGFdy TyU7dnErSNMViDZztLUgf41c5usQMe67BPrfcHp1PKWJYZTgT2pV6z25agDpT8m1Cngt /NWw== X-Gm-Message-State: AOJu0Ywlo90pQwKr3Lf7lW1j56YMAJVEh7U1bJVu/HgvH9BDY1d0iUqX o3EX7OsurjV3P/xjF8MjKkZgRg== X-Google-Smtp-Source: AGHT+IGcRZO6hKGNpAuWLFrFZeELhoPngM8y720/KDL/9ApoX5Eui0QUhXzOM2zCYFb/xTw+uU/esg== X-Received: by 2002:a5d:5847:0:b0:32f:7a22:8b42 with SMTP id i7-20020a5d5847000000b0032f7a228b42mr4559465wrf.23.1698870713110; Wed, 01 Nov 2023 13:31:53 -0700 (PDT) Received: from localhost.localdomain ([2001:871:260:b539:1410:61d3:4510:7322]) by smtp.gmail.com with ESMTPSA id y4-20020adffa44000000b0032d9382e6e0sm641637wrr.45.2023.11.01.13.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 13:31:52 -0700 (PDT) Message-ID: Subject: Re: Document target_role param of ALTER DEFAULT PRIVILEGES From: Laurenz Albe To: Bruce Momjian Cc: Jordi =?ISO-8859-1?Q?Guti=E9rrez?= Hermoso , pgsql-docs@lists.postgresql.org Date: Wed, 01 Nov 2023 21:31:52 +0100 In-Reply-To: References: <72652d72e1816bfc3c05d40f9e0e0373d07823c8.camel@octave.org> <293903c1f00f9b5053c0aa388ddc2850ae537f33.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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=C3=A9rrez 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: > > >=20 > > > https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.ht= ml > > >=20 > > > I propose an explanation like the following be added to the > > > `target_role` parameter: > > >=20 > > > 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. > >=20 > > +1. I cannot count the number of times I have seen people confused by = that. > >=20 > > Suggested patch attached. >=20 > 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. Yours, Laurenz Albe