Re: Allow CURRENT_ROLE in GRANTED BY

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow CURRENT_ROLE in GRANTED BY
Date: 2021-11-16 14:04:11
Message-ID: B7F6699A-A984-4943-B9BF-CEB84C003527@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 30 Jan 2021, at 09:51, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>
> On 2020-12-30 13:43, Simon Riggs wrote:
>> On Thu, 10 Dec 2020 at 18:40, Peter Eisentraut
>> <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>>>
>>> On 2020-06-24 20:21, Peter Eisentraut wrote:
>>>> On 2020-06-24 10:12, Vik Fearing wrote:
>>>>> On 6/24/20 8:35 AM, Peter Eisentraut wrote:
>>>>>> I was checking some loose ends in SQL conformance, when I noticed: We
>>>>>> support GRANT role ... GRANTED BY CURRENT_USER, but we don't support
>>>>>> CURRENT_ROLE in that place, even though in PostgreSQL they are
>>>>>> equivalent. Here is a trivial patch to add that.
>>>>>
>>>>>
>>>>> The only thing that isn't dead-obvious about this patch is the commit
>>>>> message says "[PATCH 1/2]". What is in the other part?
>>>>
>>>> Hehe. The second patch is some in-progress work to add the GRANTED BY
>>>> clause to the regular GRANT command. More on that perhaps at a later date.
>>>
>>> Here is the highly anticipated and quite underwhelming second part of
>>> this patch set.
>> Looks great, but no test to confirm it works. I would suggest adding a
>> test and committing directly since I don't see any cause for further
>> discussion.
>
> Committed with some tests. Thanks.

While looking at the proposed privileges.sql test patch from Mark Dilger [0] I
realized that the commit above seems to have missed the RevokeRoleStmt syntax.
As per the SQL Spec it should be supported there as well AFAICT. Was this
intentional or should the attached small diff be applied to fix it?

--
Daniel Gustafsson https://vmware.com/

[0] 333B0203-D19B-4335-AE64-90EB0FAF46F0(at)enterprisedb(dot)com

Attachment Content-Type Size
granted_by.diff application/octet-stream 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-11-16 14:27:25 Re: Allow CURRENT_ROLE in GRANTED BY
Previous Message Amit Kapila 2021-11-16 13:27:05 Re: pg_get_publication_tables() output duplicate relid