Re: SQL command : ALTER DATABASE OWNER TO

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

On Wed, 2024-01-24 at 15:26 +0100, Daniel Gustafsson wrote:
> > 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.

Here is a patch for this change.

Yours,
Laurenz Albe

Attachment Content-Type Size
v1-0001-Document-effects-of-ownership-change-on-privilege.patch text/x-patch 1.2 KB

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message vignesh C 2024-01-26 13:31:32 Re: create table explicitly mention that unique|primary key constraint will create an
Previous Message David G. Johnston 2024-01-25 21:10:22 Re: SQL command : ALTER DATABASE OWNER TO