From: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: AW: [Extern] Re: postgres event trigger workaround
Date: Fri, 14 Jan 2022 09:01:12 +0000
Message-ID: <6b39241e48fe4f2b8d7f37a5df015536@zuerich.ch> (raw)
In-Reply-To: <20220112125517.idglbczyiargb56f@jrouhaud>
References: <c32ee50d6e3b4c58b08fccccf0ade41d@zuerich.ch>
<20220112125517.idglbczyiargb56f@jrouhaud>
>
> Hi,
>
> On Wed, Jan 12, 2022 at 11:57:45AM +0000, Zwettler Markus (OIZ) wrote:
> >
> > PG event triggers are not firing on CREATE ROLE, CREATE DATABASE,
> > CREATE TABLESPACE by definition (would be nice if they do).
> >
> > Is there any workaround to react with ddl_command_start behavior on
> > such an event?
>
> That's not possible. The limitation exists because those objects are shared objects
> and therefore could be created from any database in the cluster.
>
> What is your use case? Maybe you could rely on logging all DDL instead for
> instance.
>
We have the need to separate user (role) management from infrastructure (database) management.
Granting CREATEROLE to any role also allows this role to create other roles having CREATEDB privileges and therefore also getting CREATEDB privileges.
My use case would have been to grant CREATEROLE to any role while still restricting "create database".
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: Markus.Zwettler@zuerich.ch, rjuju123@gmail.com
Subject: Re: [Extern] Re: postgres event trigger workaround
In-Reply-To: <6b39241e48fe4f2b8d7f37a5df015536@zuerich.ch>
References: <c32ee50d6e3b4c58b08fccccf0ade41d@zuerich.ch> <20220112125517.idglbczyiargb56f@jrouhaud> <6b39241e48fe4f2b8d7f37a5df015536@zuerich.ch>
* 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