From: Александр Аникин <anikin24@list.ru>
To: pgsql-hackers@postgresql.org
To: pgsql-admin@postgresql.org
Cc: borey2005@gmail.com
Subject: Create roles trigger
Date: Thu, 27 Sep 2018 12:07:48 +0300
Message-ID: <1538039268.772929533@f494.i.mail.ru> (raw)
Hey, folks!
I've got a question about events on roles creation.
I need to execute some custom logic on role creation.
All information about roles located in `pg_authid` table.
The first thing that comes to mind is to create trigger on `pg_authid` table, but this is not possible, because this is a system table.
Next thing, is to create a view (select * from pg_authid) and create trigger on view, but this didn't work out too.
One more thing is to create event trigger (CREATE EVENT TRIGGER trigger ON ddl_command_start WHEN TAG IN ('CREATE ROLE')), but it's also not possible, event triggers are not supported for 'CREATE ROLE'.
Is there is any possibility to do that ? May be, create custom extension or something else.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: anikin24@list.ru, pgsql-hackers@postgresql.org, borey2005@gmail.com
Subject: Re: Create roles trigger
In-Reply-To: <1538039268.772929533@f494.i.mail.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox