"Bossart, Nathan" <bossa...@amazon.com> writes:
> On 10/27/21, 10:22 AM, "Joshua Brindle" <joshua.brin...@crunchydata.com> 
> wrote:
>> On Wed, Oct 27, 2021 at 1:12 PM Mark Dilger
>> <mark.dil...@enterprisedb.com> wrote:
>>> I don't understand the purpose of this.  You are defining 
>>> can_set_role(member,role) as a simple wrapper around 
>>> is_member_of_role(member,role).  Couldn't the comment:

> I think a comment about the intended usage is sufficient.

I agree with the position that a better function header comment is
sufficient.  However, if we're to rename it, please not "can_set_role".
That's bad in at least two ways:

* it's quite unclear what "set" means in this context ... maybe the
function is testing whether you're allowed to alter properties of
the role, or do "ALTER ROLE ... SET parameter = value"?  It only makes
sense if you already know that the specific command SET ROLE is being
thought of.

* it's unclear which argument is which end of the relationship.

Something like "can_set_role_to()" would help with the second problem,
but I'm not sure it does much for the first one.

On the whole I think the existing name is fine.

                        regards, tom lane


Reply via email to