Create Postgres Event Trigger in AWS-RDS

Viewed 3325

I need an event trigger on my RDS Postgres database. Ultimately, I need to be notified whenever there is a change to the schema. In plain old Postgres (i.e. a non-RDS instance) this works fine. However, in RDS running the following:

CREATE EVENT TRIGGER audit ON ddl_command_start EXECUTE PROCEDURE stat_audit();

Results in:

ERROR:  permission denied to create event trigger
HINT:  Must be superuser to create an event trigger.

As far as I understand the most privileged role on RDS is rds_superuser. I have granted rds_superuser to my account (e.g. grant rds_superuser to someuser; ). Yet I still cannot create the event trigger. I do understand that the rds_superuser is not the same exact role as the pg superuser (which can be confirmed by either running:SHOW is_superuser or SELECT * FROM pg_user). I also understand why RDS might lock-down true superuser privileges, but it seems a pretty significant limitation if I cannot access event triggers. Am I missing something? Is is possible to set an event trigger in Postgres on RDS? If not, is there any alternative to mimic the same functionality? I am aware of RDS Event Notifications, but there does not seem to be any option to subscribe to schema change events.

1 Answers
Related