From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Färber, "Franz-Josef (StMUK)" <Franz-Josef.Faerber@stmuk.bayern.de>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: AW: pg_event_trigger_ddl_commands after GRANT is quite empty
Date: Tue, 13 Oct 2026 13:10:05 +0200
Message-ID: <410d484fe9afbac8dd2c67c67db5fd73a589da3e.camel@cybertec.at> (raw)
In-Reply-To: <8e850cfaad58479faf774cab55ece2f5@stmuk.bayern.de>
References: <e76825ec4a93422aacf3b64f521c4ed5@stmuk.bayern.de>
<47ec6533d8da7e176b8e6bb167feb3d82313eed8.camel@cybertec.at>
<8e850cfaad58479faf774cab55ece2f5@stmuk.bayern.de>
On Mon, 2026-10-12 at 14:36 +0000, Färber, Franz-Josef (StMUK) wrote:
> > > pg_event_trigger_ddl_commands after GRANT is quite empty.
> > >
> > > If I execute: GRANT SELECT ON TABLE t TO r;
> > >
> > > . and in a trigger function I have:
> > >
> > > SELECT classid, objid, objsubid, command_tag, object_type, schema_name, object_identity
> > > FROM pg_event_trigger_ddl_commands();
> > >
> > > This gives me:
> > >
> > > null, null, null, GRANT, TABLE, null, null
> > >
> > >
> > > How to find out the table involved and the privileges?
> >
> > I think you have to write a C function that can do something with pg_ddl_command.
>
> A solution usable from SQL or plpgsql would've been nice.
Indeed. I am surprised that the table is not reported for a GRANT
statement. Perhaps it is because GRANT operates on all kinds of objects,
not sure. You could write a patch for PostgreSQL to improve that.
Yours,
Laurenz Albe
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: laurenz.albe@cybertec.at, Franz-Josef.Faerber@stmuk.bayern.de
Subject: Re: pg_event_trigger_ddl_commands after GRANT is quite empty
In-Reply-To: <410d484fe9afbac8dd2c67c67db5fd73a589da3e.camel@cybertec.at>
References: <e76825ec4a93422aacf3b64f521c4ed5@stmuk.bayern.de> <47ec6533d8da7e176b8e6bb167feb3d82313eed8.camel@cybertec.at> <8e850cfaad58479faf774cab55ece2f5@stmuk.bayern.de> <410d484fe9afbac8dd2c67c67db5fd73a589da3e.camel@cybertec.at>
* 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