Re: SQL command : ALTER DATABASE OWNER TO

From: gparc(at)free(dot)fr
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: SQL command : ALTER DATABASE OWNER TO
Date: 2024-01-24 14:40:20
Message-ID: 1327973565.212682013.1706107220766.JavaMail.zimbra@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs


Hello,

maybe a misunderstanding of my part, but your proposed modification doesn't matched
with the current behaviour of the command as precisely the object privileges of the old owner are **NOT** transferred
to the new owner along with the ownership

Regards
Gilles

----- Mail original -----
De: "Daniel Gustafsson" <daniel(at)yesql(dot)se>
À: "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "gparc" <gparc(at)free(dot)fr>, "pgsql-docs" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Envoyé: Mercredi 24 Janvier 2024 15:26:22
Objet: Re: SQL command : ALTER DATABASE OWNER TO

> On 24 Jan 2024, at 15:23, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
>
> On Wed, 2024-01-24 at 11:08 +0100, gparc(at)free(dot)fr wrote:
>> for this "ALTER DATABASE" form, it should be mentioned that after execution of the command,
>> the old database owner loses all his privileges on it (even connection) although it might
>> still owns schemas or objects (tables, index,...) inside it.
>>
>> Thanks in advance to add this important precision.
>
> How about this:
>
> diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
> index 4044f0908f..44042f863c 100644
> --- a/doc/src/sgml/ddl.sgml
> +++ b/doc/src/sgml/ddl.sgml
> @@ -1891,6 +1891,8 @@ ALTER TABLE <replaceable>table_name</replaceable> OWNER TO <replaceable>new_owne
> Superusers can always do this; ordinary roles can only do it if they are
> both the current owner of the object (or inherit the privileges of the
> owning role) and able to <literal>SET ROLE</literal> to the new owning role.
> + All object privileges of the old owner are transferred to the new owner
> + along with the ownership.
> </para>

Doesn't seem unreasonable to me, it won't make the docs harder to read and use
for experienced users while it may make them easier to follow for new users.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Daniel Gustafsson 2024-01-24 14:58:19 Incorrect grammar on ALTER EVENT TRIGGER
Previous Message Laurenz Albe 2024-01-24 14:39:46 Spam complaint