pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Bruce Momjian <bruce@momjian.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Jordi GutiƩrrez Hermoso <jordigh@octave.org>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Document target_role param of ALTER DEFAULT PRIVILEGES
Date: Wed, 1 Nov 2023 13:09:59 -0400
Message-ID: <ZUKGZ4BSL0p3Pn4p@momjian.us> (raw )
In-Reply-To: <293903c1f00f9b5053c0aa388ddc2850ae537f33.camel@cybertec.at >
References: <72652d72e1816bfc3c05d40f9e0e0373d07823c8.camel@octave.org >
<293903c1f00f9b5053c0aa388ddc2850ae537f33.camel@cybertec.at >
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 <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
Attachments:
[text/x-diff] role.diff (848B, ../ZUKGZ4BSL0p3Pn4p@momjian.us/2-role.diff)
download | inline 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 ]
<listitem>
<para>
The name of an existing role of which the current role is a member.
- If <literal>FOR ROLE</literal> is omitted, the current role is assumed.
+ Default access privileges are not inherited, so member roles
+ must use <command>SET ROLE</command> to access these privileges,
+ or <command>ALTER DEFAULT PRIVILEGES</command> must be run for
+ each member role. If <literal>FOR ROLE</literal> is omitted,
+ the current role is assumed.
</para>
</listitem>
</varlistentry>
view thread (7+ messages) latest in thread
Message-ID: <ZUKGZ4BSL0p3Pn4p@momjian.us>
Permalink: ../ZUKGZ4BSL0p3Pn4p@momjian.us/
Also on: postgresql.org/message-id/ZUKGZ4BSL0p3Pn4p@momjian.us
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: bruce@momjian.us, laurenz.albe@cybertec.at, jordigh@octave.org, pgsql-docs@lists.postgresql.org
Subject: Re: Document target_role param of ALTER DEFAULT PRIVILEGES
In-Reply-To: <ZUKGZ4BSL0p3Pn4p@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox