I am using Microsoft Azure Database for PostgreSQL with PostgreSQL 10 installed. As I'm trying to work on future tables together with other users I want to enable the other users to alter my tables as well.

I've created a role pgpublish and all users are members of the role. For a new table, which I created, I altered the table owner to the role pgpublish. Now everyone with the role pgpublish is able to alter the table:

ALTER TABLE "MYcoolSchema"."CoolNewTable" OWNER TO pgpublish;

To make this more automatic/generic, I created a trigger function and tried to create an event trigger as explained here.

Unfortunately I can't create the event trigger (The trigger function works fine), as it is stated:

ERROR: permission denied to create event trigger
"trg_create_set_owner" HINT: Must be superuser to create an event trigger. 
SQL state: 42501

Is there a workaround for creating event triggers on Microsoft Azure Database for PostgreSQL? How can this look like?

I could run a cron job on another system to scan for new tables and alter the owner of these new tables to pgpublish but this is not cool at all.

  • It seems like I need to use runbooks and azure automation to do the work on a scheduled basis... – Riccardo Jan 3 '19 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.