SQL command : ALTER DATABASE OWNER TO

2022-03-08 Thread gparc
Hello, 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 pre

Re: SQL command : ALTER DATABASE OWNER TO

2022-03-08 Thread Bruce Momjian
On Tue, Mar 8, 2022 at 10:50:38AM +0100, gp...@free.fr wrote: > > Hello, > > 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 objec

Re: SQL command : ALTER DATABASE OWNER TO

2022-03-08 Thread David G. Johnston
On Tue, Mar 8, 2022 at 7:39 AM Bruce Momjian wrote: > On Tue, Mar 8, 2022 at 10:50:38AM +0100, gp...@free.fr wrote: > > > > Hello, > > > > 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

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
Hello, as one of my colleagues fell into the same trap I repeat my request for correction of the documentation on this subject. Many thanks in advance Regards Gilles - Mail original - De: "gparc" À: "pgsql-docs" Envoyé: Mardi 8 Mars 2022 10:50:38 Objet: SQL comm

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Laurenz Albe
On Wed, 2024-01-24 at 11:08 +0100, gp...@free.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,...)

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Daniel Gustafsson
> On 24 Jan 2024, at 15:23, Laurenz Albe wrote: > > On Wed, 2024-01-24 at 11:08 +0100, gp...@free.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

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
ginal - De: "Daniel Gustafsson" À: "Laurenz Albe" Cc: "gparc" , "pgsql-docs" 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 wrote: > > On Wed, 2024-01-24 a

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Laurenz Albe
On Wed, 2024-01-24 at 15:40 +0100, gp...@free.fr wrote: > 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 t

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 8:35 AM Laurenz Albe wrote: > On Wed, 2024-01-24 at 15:40 +0100, gp...@free.fr wrote: > > 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 own

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Laurenz Albe
On Wed, 2024-01-24 at 08:47 -0700, David G. Johnston wrote: > I dislike this change, ownership of an object is completely independent of > the grant system of privileges.  The granted privileges of the old row do > not transfer to the new owner when alter ... owner to is executed.  CREATE TABLE my

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
- Mail original - De: "Laurenz Albe" À: "gparc" , "Daniel Gustafsson" Cc: "pgsql-docs" Envoyé: Mercredi 24 Janvier 2024 16:35:10 Objet: Re: SQL command : ALTER DATABASE OWNER TO On Wed, 2024-01-24 at 15:40 +0100, gp...@free.fr wrote: > ma

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 9:13 AM Laurenz Albe wrote: > On Wed, 2024-01-24 at 08:47 -0700, David G. Johnston wrote: > > I dislike this change, ownership of an object is completely independent > of > > the grant system of privileges. The granted privileges of the old row do > > not transfer to the

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
De: "David G. Johnston" À: "Laurenz Albe" Cc: "gparc" , "Daniel Gustafsson" , "pgsql-docs" Envoyé: Mercredi 24 Janvier 2024 17:36:43 Objet: Re: SQL command : ALTER DATABASE OWNER TO On Wed, Jan 24, 2024 at 9:13 AM Laurenz Alb

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 9:23 AM wrote:- > [postgres] $ psql > psql (14.10) > > You really should add commentary, especially since you never demonstrated the tst role (I advise picking different names for all of the objects in the future) being unable to login. Which they should be able to since

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Alvaro Herrera
On 2024-Jan-24, Laurenz Albe wrote: > The permissions are transferred to the new owner, so the old owner doesn't > have any privileges on the object (and, in your case, cannot connect to > the database any more). However, if the old owner had a pg_hba.conf line that allowed them in, and the new o

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 9:56 AM Alvaro Herrera wrote: > On 2024-Jan-24, Laurenz Albe wrote: > > > The permissions are transferred to the new owner, so the old owner > doesn't > > have any privileges on the object (and, in your case, cannot connect to > > the database any more). > > However, if th

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Tom Lane
"David G. Johnston" writes: > On Wed, Jan 24, 2024 at 8:35 AM Laurenz Albe > wrote: >> The permissions are transferred to the new owner, so the old owner doesn't >> have any privileges on the object (and, in your case, cannot connect to >> the database any more). > I dislike this change, ownersh

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
De: "David G. Johnston" À: "gparc" Cc: "Laurenz Albe" , "Daniel Gustafsson" , "pgsql-docs" Envoyé: Mercredi 24 Janvier 2024 17:50:17 Objet: Re: SQL command : ALTER DATABASE OWNER TO On Wed, Jan 24, 2024 at 9:23 AM < [ mailto:gp.

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread Tom Lane
"David G. Johnston" writes: > postgres=# grant all on database newdb2 to testowner; > -- as I am logged in as davidj this grant should actually happen, with > davidj as the grantor > -- the grants that materialize from ownership has the owning role as the > grantor Yes. The FM points out somewhe

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 10:13 AM Tom Lane wrote: > "David G. Johnston" writes: > > postgres=# grant all on database newdb2 to testowner; > > -- as I am logged in as davidj this grant should actually happen, with > > davidj as the grantor > > -- the grants that materialize from ownership has the

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread gparc
afsson" , "pgsql-docs" Envoyé: Mercredi 24 Janvier 2024 18:11:30 Objet: Re: SQL command : ALTER DATABASE OWNER TO De: "David G. Johnston" À: "gparc" Cc: "Laurenz Albe" , "Daniel Gustafsson" , "pgsql-docs" Envoyé: Mercred

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-24 Thread David G. Johnston
On Wed, Jan 24, 2024 at 7:23 AM Laurenz Albe wrote: > On Wed, 2024-01-24 at 11:08 +0100, gp...@free.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

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-25 Thread Laurenz Albe
On Wed, 2024-01-24 at 16:04 -0700, David G. Johnston wrote: > Here's a slightly more detailed patch to consider to cover both the > transference of ownership as well as documenting precisely what ownership > means. > > diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml > index fc03a349f0

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-25 Thread David G. Johnston
Thank you for the feedback. I've taken it into account and come up with a partial rewrite of my first pass, and posted it to -hackers so we can close this thread out. https://www.postgresql.org/message-id/cakfquwyy3ei05kpggk2del_pe5yjkdybxb362xuthovpqjf...@mail.gmail.com Some replies below. On

Re: SQL command : ALTER DATABASE OWNER TO

2024-01-26 Thread Laurenz Albe
On Wed, 2024-01-24 at 15:26 +0100, Daniel Gustafsson wrote: > > On 24 Jan 2024, at 15:23, Laurenz Albe wrote: > > > > On Wed, 2024-01-24 at 11:08 +0100, gp...@free.fr wrote: > > > for this "ALTER DATABASE" form, it should be mentioned that after > > > execution of the command, > > > the old data