• Stan Hu's avatar
    Fix database permission check for triggers on Amazon RDS · 91ecb6a6
    Stan Hu authored
    On some instances of Amazon RDS, running a SELECT against
    `'information_schema.role_table_grants'` fails with a `permission denied
    for relation pg_authid` error. This happens because `role_table_grants`
    is a PostgreSQL view that ultimately accesses the `pg_authid` table.
    
    The PostgreSQL system function `has_table_privileges` doesn't actually
    need a FROM clause. We can simplify the query to just call:
    
    SELECT has_table_privilege('projects', 'TRIGGER')
    
    Closes https://gitlab.com/gitlab-org/gitlab/issues/199468
    91ecb6a6
sh-fix-trigger-check-rds.yml 109 Bytes