Thread

  1. [PATCH] Fix incorrect parser comment

    David Christensen <david@pgguru.net> — 2026-01-14T19:26:03Z

    Noted when doing some other unrelated changes; these are RoleSpec
    nodes, not String.  This comment has been wrong for ~ 10 years. :D
    
  2. Re: [PATCH] Fix incorrect parser comment

    Chao Li <li.evan.chao@gmail.com> — 2026-01-16T00:51:52Z

    
    > On Jan 15, 2026, at 03:26, David Christensen <david@pgguru.net> wrote:
    > 
    > Noted when doing some other unrelated changes; these are RoleSpec
    > nodes, not String.  This comment has been wrong for ~ 10 years. :D
    > <0001-Fix-incorrect-parser-comment.patch>
    
    I think this is a good catch. The error isn't immediately obvious at a glance.
    
    To provide the fix:
    
    ```
    typedef struct GrantRoleStmt
    {
    NodeTag type;
    List *granted_roles; /* list of roles to be granted/revoked */
    List *grantee_roles; /* list of member roles to add/delete */
    ```
    
    grantee_roles is defined as a List in GrantRoleStmt, and it is passed to roleSpecsToIds():
    
    ```
    grantee_ids = roleSpecsToIds(stmt->grantee_roles);
    ```
    
    Then roleSpecsToIds() iterates the list with type RoleSpec:
    
    ```
    List *
    roleSpecsToIds(List *memberNames)
    {
      List *result = NIL;
      ListCell *l;
    
      foreach(l, memberNames)
      {
        RoleSpec *rolespec = lfirst_node(RoleSpec, l);
        Oid roleid;
    
        roleid = get_rolespec_oid(rolespec, false);
        result = lappend_oid(result, roleid);
      }
      return result;
    }
    ```
    
    So, the fix LGTM.
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  3. Re: [PATCH] Fix incorrect parser comment

    Michael Paquier <michael@paquier.xyz> — 2026-01-16T07:18:53Z

    On Wed, Jan 14, 2026 at 01:26:03PM -0600, David Christensen wrote:
    > Noted when doing some other unrelated changes; these are RoleSpec
    > nodes, not String.  This comment has been wrong for ~ 10 years. :D
    
    Indeed, thanks.  Adding that to my stack for later.
    --
    Michael