Thread

  1. Possible bug acldefault function

    Inzamam Shafiq <inzamam.shafiq@hotmail.com> — 2025-03-19T12:49:14Z

    Hi Team,
    
    I came across an issue while working with acldefault function on materialized view, which threw an error "ERROR: unrecognized objtype abbreviation: m", when I looked at the source code of acldefault_sql it seems that materialized view case is not handled there, the SQL statement which I was executing is as follows,
    
    `select relname, relowner, acldefault(relkind, relowner) as acl from pg_class where relkind in ('r', 'p', 'v', 'm');`
    
    
    Please note that the value of relacl column in pg_class is NULL, upon assigning the permission explicitly the error goes away.
    
    I'm not sure if it is truly a bug or I have some misunderstanding about the function.
    
    Your guidance will be helpful to get better understanding of the issue.
    
    Thank you.
    
    Get Outlook for Android<https://aka.ms/AAb9ysg>
    
  2. Re: Possible bug acldefault function

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-03-19T15:45:20Z

    Inzamam Shafiq <inzamam.shafiq@hotmail.com> writes:
    > I came across an issue while working with acldefault function on materialized view, which threw an error "ERROR: unrecognized objtype abbreviation: m", when I looked at the source code of acldefault_sql it seems that materialized view case is not handled there, the SQL statement which I was executing is as follows,
    
    No, acldefault doesn't consider 'm' to be valid input, because
    materialized views are not a distinct kind of object for ACL purposes;
    they're just relations (tables), and have relation-y privileges.
    
    In fact, none of the object type codes accepted by acldefault_sql
    are relkind values, except for the accidental overlap of 'r' with
    the relkind for plain tables.
    
    			regards, tom lane