Thread

Commits

  1. Add missing command for pg_maintain in comment

  1. ACL_MAINTAIN, Lack of comment content

    btsugieyuusuke <btsugieyuusuke@oss.nttdata.com> — 2024-09-30T08:29:03Z

    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
    
    
    
    
  2. Re: ACL_MAINTAIN, Lack of comment content

    Daniel Gustafsson <daniel@yesql.se> — 2024-09-30T09:40:29Z

    > On 30 Sep 2024, at 10:29, btsugieyuusuke <btsugieyuusuke@oss.nttdata.com> wrote:
    > 
    > 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?
    
    That's correct, for the list to be complete LOCK TABLE should be added as per
    the attached.
    
    --
    Daniel Gustafsson
    
    
  3. Re: ACL_MAINTAIN, Lack of comment content

    Yugo Nagata <nagata@sraoss.co.jp> — 2024-09-30T10:38:35Z

    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>
    
    
    
    
  4. Re: ACL_MAINTAIN, Lack of comment content

    Daniel Gustafsson <daniel@yesql.se> — 2024-09-30T14:13:55Z

    > 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
    
    
    
    
    
  5. Re: ACL_MAINTAIN, Lack of comment content

    Nathan Bossart <nathandbossart@gmail.com> — 2024-09-30T14:17:29Z

    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
    
    
    
    
  6. Re: ACL_MAINTAIN, Lack of comment content

    Tom Lane <tgl@sss.pgh.pa.us> — 2024-09-30T15:43:18Z

    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
    
    
    
    
  7. Re: ACL_MAINTAIN, Lack of comment content

    Daniel Gustafsson <daniel@yesql.se> — 2024-09-30T22:04:14Z

    > 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