I need an event trigger in my Postgres RDS database. Ultimately, I need to be notified of every change to the schema. On a regular old Postgres (i.e. non-RDS instance) this works fine. However, the following is done in RDS:
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 I understand it, the most privileged role in RDS is rds_superuser. I provided rds_superuser for my account (e.g. grant rds_superuser to someuser;
). But I still can not create an event trigger. I understand that rds_superuser is not the same as the superuser pg (which can be confirmed either by running: SHOW is_superuser
, or SELECT * FROM pg_user
). I also understand why RDS can block true superuser privileges, but this seems like a pretty significant limitation if I cannot access event triggers. Am I missing something? Is it possible to set an event trigger in Postgres on RDS? If not, is there an alternative to mimicking the same functionality? I know RDS event notifications, but there seems to be no way to subscribe to schema change events.
source share