Thread: ACL_MAINTAIN, Lack of comment content

ACL_MAINTAIN, Lack of comment content

From
btsugieyuusuke
Date:
Hi hackers,
I found a flaw in the ACL_MAINTAIN comment.

Commands such as VACUUM are listed as commands that are allowed to be 
executed by the MAINTAIN privilege.
However, LOCK TABLE is missing from the comment.

>     /*
>      * Check if ACL_MAINTAIN is being checked and, if so, and not already 
> set
>      * as part of the result, then check if the user is a member of the
>      * pg_maintain role, which allows VACUUM, ANALYZE, CLUSTER, REFRESH
>      * MATERIALIZED VIEW, and REINDEX on all relations.
>      */

Therefore, shouldn't LOCK TABLE be added to the comment?

Best regards,
Yusuke Sugie



Re: ACL_MAINTAIN, Lack of comment content

From
Yugo Nagata
Date:
On Mon, 30 Sep 2024 11:40:29 +0200
Daniel Gustafsson <daniel@yesql.se> wrote:

> -     * MATERIALIZED VIEW, and REINDEX on all relations.
> +     * MATERIALIZED VIEW, REINDEX and LOCK TABLE on all relations.

Should we put a comma between REINDEX and "and" as following?

 "... MATERIALIZED VIEW, REINDEX, and LOCK TABLE on all relations."

Regards,
Yugo Nagata 

-- 
Yugo Nagata <nagata@sraoss.co.jp>



Re: ACL_MAINTAIN, Lack of comment content

From
Daniel Gustafsson
Date:
> On 30 Sep 2024, at 12:38, Yugo Nagata <nagata@sraoss.co.jp> wrote:
>
> On Mon, 30 Sep 2024 11:40:29 +0200
> Daniel Gustafsson <daniel@yesql.se> wrote:
>
>> - * MATERIALIZED VIEW, and REINDEX on all relations.
>> + * MATERIALIZED VIEW, REINDEX and LOCK TABLE on all relations.
>
> Should we put a comma between REINDEX and "and" as following?
>
> "... MATERIALIZED VIEW, REINDEX, and LOCK TABLE on all relations."

I'm not a native speaker so I'm not sure which is right, but grepping for other
lists of items shows that the last "and" item is often preceded by a comma so
I'll do that.

--
Daniel Gustafsson




Re: ACL_MAINTAIN, Lack of comment content

From
Nathan Bossart
Date:
On Mon, Sep 30, 2024 at 04:13:55PM +0200, Daniel Gustafsson wrote:
>> On 30 Sep 2024, at 12:38, Yugo Nagata <nagata@sraoss.co.jp> wrote:
>> 
>> Should we put a comma between REINDEX and "and" as following?
>> 
>> "... MATERIALIZED VIEW, REINDEX, and LOCK TABLE on all relations."
> 
> I'm not a native speaker so I'm not sure which is right, but grepping for other
> lists of items shows that the last "and" item is often preceded by a comma so
> I'll do that.

I'm not aware of a project policy around the Oxford comma [0], but I tend
to include one.

[0] https://en.wikipedia.org/wiki/Serial_comma

-- 
nathan



Re: ACL_MAINTAIN, Lack of comment content

From
Tom Lane
Date:
Nathan Bossart <nathandbossart@gmail.com> writes:
> On Mon, Sep 30, 2024 at 04:13:55PM +0200, Daniel Gustafsson wrote:
>> I'm not a native speaker so I'm not sure which is right, but grepping for other
>> lists of items shows that the last "and" item is often preceded by a comma so
>> I'll do that.

> I'm not aware of a project policy around the Oxford comma [0], but I tend
> to include one.

Yeah, as that wikipedia article suggests, you can find support for
either choice.  I'd say do what looks best in context.

            regards, tom lane



Re: ACL_MAINTAIN, Lack of comment content

From
Daniel Gustafsson
Date:
> On 30 Sep 2024, at 17:43, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Nathan Bossart <nathandbossart@gmail.com> writes:
>> On Mon, Sep 30, 2024 at 04:13:55PM +0200, Daniel Gustafsson wrote:
>>> I'm not a native speaker so I'm not sure which is right, but grepping for other
>>> lists of items shows that the last "and" item is often preceded by a comma so
>>> I'll do that.
>
>> I'm not aware of a project policy around the Oxford comma [0], but I tend
>> to include one.
>
> Yeah, as that wikipedia article suggests, you can find support for
> either choice.  I'd say do what looks best in context.

Thanks for input, I ended up keeping the comma.

--
Daniel Gustafsson