Re: CREATEROLE and role ownership hierarchies

From: Joshua Brindle <joshua(dot)brindle(at)crunchydata(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: CREATEROLE and role ownership hierarchies
Date: 2022-01-04 14:35:31
Message-ID: CAGB+Vh5EySCfH9C4brq2es+xoH=VXXSihZJ8hArUUi-XgZdjDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 3, 2022 at 5:08 PM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>
> On 12/23/21 16:06, Joshua Brindle wrote:
> > On Tue, Dec 21, 2021 at 8:26 PM Mark Dilger
> > <mark(dot)dilger(at)enterprisedb(dot)com> wrote:
> >>
> >>
> >>> On Dec 21, 2021, at 5:11 PM, Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com> wrote:
> >>>
> >>> I fixed the patches because they cannot be applied to HEAD.
> >> Thank you.
> > I reviewed and tested these and they LGTM. FYI the rebased v3 patches
> > upthread are raw diffs so git am won't apply them.
>
>
> That's not at all unusual. I normally apply patches just using
>
> patch -p 1 < $patchfile
>
> > I can add myself to
> > the CF as a reviewer if it is helpful.
>
>
> Please do.

I just ran across this and I don't know if it is intended behavior or
not, can you tell me why this happens?

postgres=> \du+
List of roles
Role name | Owner | Attributes
| Member of | Description
-----------+----------+------------------------------------------------------------+-----------+-------------
brindle | brindle | Password valid until 2022-01-05 00:00:00-05
| {} |
joshua | postgres | Create role
| {} |
postgres | postgres | Superuser, Create role, Create DB,
Replication, Bypass RLS | {} |

postgres=> \password
Enter new password for user "brindle":
Enter it again:
ERROR: role "brindle" with OID 16384 owns itself

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-01-04 14:37:44 Re: refactoring basebackup.c
Previous Message Peter Eisentraut 2022-01-04 14:24:54 Re: [PATCH] Allow multiple recursive self-references