AW: [Extern] Re: postgres event trigger workaround

From: "Zwettler Markus (OIZ)" <Markus(dot)Zwettler(at)zuerich(dot)ch>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: AW: [Extern] Re: postgres event trigger workaround
Date: 2022-01-14 09:01:12
Message-ID: 6b39241e48fe4f2b8d7f37a5df015536@zuerich.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> 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".

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2022-01-14 10:22:15 Re: [Extern] Re: postgres event trigger workaround
Previous Message David G. Johnston 2022-01-14 00:31:49 Re: How can a Postgres SQL script be automatically run when a new table turns up?