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 1rSeQU-00F2xp-JB for pgsql-docs@arkaria.postgresql.org; Wed, 24 Jan 2024 14:40:27 +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 1rSeQT-005Y9W-JZ for pgsql-docs@arkaria.postgresql.org; Wed, 24 Jan 2024 14:40:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSeQT-005Y9O-A2 for pgsql-docs@lists.postgresql.org; Wed, 24 Jan 2024 14:40:25 +0000 Received: from smtp3-g21.free.fr ([212.27.42.3]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSeQQ-003UBA-S5 for pgsql-docs@lists.postgresql.org; Wed, 24 Jan 2024 14:40:24 +0000 Received: from zimbra-e1-02.priv.proxad.net (unknown [172.20.243.240]) by smtp3-g21.free.fr (Postfix) with ESMTP id DA8BF13F880; Wed, 24 Jan 2024 15:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1706107221; bh=iI6fIBr6RdgvIyk7xi3eH7WYzt8vx51138+gGmj1cj0=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=BG9wFMzJ8vLs0/i7QbRJVpJ6hHxWwDZEQEbXzNQlR0MUqVCjEd1EH7RvoOfHPwYu3 GafONiDgljkXJPLvuvXmRj5yHtCC21grhAtmnV9SzLRqiqW4MLe+NsVh09exXDFb5f xoptsFxE65MCAgowRuEMlV+bQMs++O7Gn8T8Ji3YHeBGV5SnzGdm6y2ULFVy4DpLB1 sO5KrDjy7io6zqaHYpbeEP7MgYyFYQo6odmxzXzuoEEAhGIlFvMKrKozHBaVrNG0jY QwYNZWE1TDhh/ZWoCNWb1C2Ebvsw3gcxPIoCP1kvJTS/2oJT0aWOzixp3yKnRJkG/h 8LUvPouhnoP1w== Date: Wed, 24 Jan 2024 15:40:20 +0100 (CET) From: gparc@free.fr To: Daniel Gustafsson Cc: Laurenz Albe , pgsql-docs Message-ID: <1327973565.212682013.1706107220766.JavaMail.zimbra@free.fr> In-Reply-To: References: <2023185982.281851219.1646733038464.JavaMail.root@zimbra15-e2.priv.proxad.net> <1712096587.208766558.1706090901073.JavaMail.zimbra@free.fr> Subject: Re: SQL command : ALTER DATABASE OWNER TO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [145.242.20.128] X-Mailer: Zimbra 9.0.0_GA_1337 (ZimbraWebClient - FF102 (Linux)/9.0.0_GA_1337) Thread-Topic: SQL command : ALTER DATABASE OWNER TO Thread-Index: ExIuC/BKUOTnXRN66y0trrvJtBzeag== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 privilege= s of the old owner are **NOT** transferred to the new owner along with the ownership Regards Gilles ----- Mail original ----- De: "Daniel Gustafsson" =C3=80: "Laurenz Albe" Cc: "gparc" , "pgsql-docs" Envoy=C3=A9: Mercredi 24 Janvier 2024 15:26:22 Objet: Re: SQL command : ALTER DATABASE OWNER TO > On 24 Jan 2024, at 15:23, Laurenz Albe wrote: >=20 > On Wed, 2024-01-24 at 11:08 +0100, gparc@free.fr wrote: >> for this "ALTER DATABASE" form, it should be mentioned that after execut= ion 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. >>=20 >> Thanks in advance to add this important precision. >=20 > How about this: >=20 > 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 table_name O= WNER TO new_owne > Superusers can always do this; ordinary roles can only do it if they a= re > both the current owner of the object (or inherit the privileges of the > owning role) and able to SET ROLE to the new owning= role. > + All object privileges of the old owner are transferred to the new own= er > + along with the ownership. > 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