Skip to content

Fix database permission check for triggers on Amazon RDS

Stan Hu requested to merge sh-fix-trigger-check-rds into master

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, which according to https://stackoverflow.com/a/55459113 is not available on RDS. (It worked for me, though.)

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 #199468 (closed)

Edited by Stan Hu

Merge request reports