Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xGhdD-00000002ZCL-3gXm for pgsql-general@arkaria.postgresql.org; Tue, 13 Oct 2026 18:53:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xGhdC-0000000Fn0v-1TQf for pgsql-general@arkaria.postgresql.org; Tue, 13 Oct 2026 18:53:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xGhdB-0000000Fn0m-1Ft0 for pgsql-general@lists.postgresql.org; Tue, 13 Oct 2026 18:53:46 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xGhd7-00000001v7l-2avt for pgsql-general@postgresql.org; Tue, 13 Oct 2026 18:53:44 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 0E68CEC03D5 for ; Tue, 13 Oct 2026 14:53:39 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 13 Oct 2026 14:53:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1791917619; x= 1792004019; bh=MUuPQiy8PiiXFwNMXIHtROqm7SO9bA1M3SpePfks3z0=; b=k 3MQkC0w/U5RS4pqKv+EJbVhjQUTrdKfLTHjKYtOEwWRkEP74Hc2RfVtQ37auPXJS 7sb5vjDePwkwEyEgi2R+u2z4dGTZgth0t+eaja35EP0whQeIPpfxsFPjq1OVlSnp PGj6dS+ZPn78z6YbgzPvJF5tuEEDcuIEXkrCbGmR+jYdpWGze0WHd0o3mQid55JS /ae4Cj39bZ6rO7dcWpViSP9xseVc7mXObr1cQmmZhkInZFsbKu2GAGcNQhjYCx7W /UsA76Hj25Tlxdr0bm0JT0i8F4K2Zuy6IyOkh5njNTzM95yDO2HozQAZsLby9D6b wA1dowBy4/1vRLiRkKjMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1791917619; x=1792004019; bh=M UuPQiy8PiiXFwNMXIHtROqm7SO9bA1M3SpePfks3z0=; b=QGo+p9Aom9k8lIzcP hv3tjgcU+GNcVZRe9BDxIzJXgjgj+S6X5QdVH2GmddxDG5HV/9tOhINRP2VFy/kz shWnE1xdCMixB2Dht5j2nKf68SgDN2oi//f2L0zfB5ZkvlHsvbPYXELuZngdinHi 09uPTkrSUj8L0T1V+2pwQ1i8TzhRjEPV+DE2V/Qg6O9wwSasXH85FNtj5THuSQem ENg17u/XK8CT8FO0FF5WydxLQ86gh5MIjLT1JGX03A7LNMMzhFGGt8sES+SeduBD KfwfUJMCksgIMeRlpGPiFlszTOtT6NP4ByRDW/c+LAfn8rxdLIf/ey4NcCIQ6N5R 4Lr6Q== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=sign d=kurilemu.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1791917619; d=kurilemu.de; mf=PGFsdmhlcnJlQGt1cmlsZW11LmRlPg==; rt=PHBnc3FsLWdlbmVyYWxAcG9zdGdyZXNxbC5vcmc+; s=fm3:rsa-sha256:ei8Fvi25Zbewkrel45vx6+O5tTuhjQ84/+zmgd3UynpGDOj rM9APEfNUE5ANS6T+JyDf75oHHt/QsAEgm65mW0JgyEcwKY147Mh86UOAMDY0koq St36pBgoI3fNyJXJvRW/5VkafDa+JPtv1TrLsdxJ/xZ1m0IWyIiKbCf8a+oqVzGm GN926bQLm+tuRnmD+DuBqsiFWJw1dv957geoK9U+oNpK6VOWnl6lfA1Xed+muMMP yp/cTHWf15qohXXMwL/v6He338eNkB3EMD7h/wtP2x0c0fCDFE8M62b86c6zjGPJ DVavz0R4fg9cigdZjrfRWjkGPPnKClXgjkUkN+A==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,subject,to; Message-Instance: m=1; h=sha256:SKoVzAFwhL2XlKcDnQpF9/nWEDz//rQ7AlhEpbXakns=:F59BhMxzLmIEWGLPVD9QMJcDRlLqFRld+GUxiGHGCw4=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEPfWc83fP97a+g9qKjjugtlpfHCTRy3imDWBDA/yDqhs/pbrbCR6QZHbd5h/6d/a WUVRlP2UB7na/ioXybmtWtxvLDDg72A0ohn0xJor1XJtGeqv9JJmDnLyM3uORLq6ij7z/7 UPi1mZjQVvHHsOvPNStr1KdLeZkrY6BQKcElqzgOlAwwBI1lsi7oRCV0Nkq3L457nwGXOt JHbu5eESIN7BgaSBdBPfSn/jdRjPMYf1iryStXnVrLwaIrQfVAGfC/Fk4QjSa+BSgiIIcL cXEMxFAk0Gy3O/m0/8nXA4pSAZgOaAx8kEPwMv4zMofIiov2PirMLjVZ+kDSj9ZWgnzGFL RWkOihcPZ+T9ot7hV7ynuho5bz01LnrRSLQvDCm5qvm4OdP7FpfyBc3LCGg2I4fOxljEAL msd2lp4Rs/Nczz7P/Ha7ZjWl2uCqhJT+UbekcFeR43E6LojIkc1qwYCd+zbDMJ+/YF50VV NEXQA5eUrKshIgtF5krw2I+fJmNvy+dAcU71EOWGgLJvO+7bWGN3cmJZfUc0FSKbLLQdy8 fhF2EhTNDkf8SfZM7AmR3CbTQw8VgCYiYzgOsn2xaedzkrC8La039aMUW+WgoWbWssEfL4 4iuhdqRykwD0g+Wc4mGjQnj5N1aw2kNwSYWPOQouvzL5QTCOUWbz6dBi+5Tw X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Oct 2026 14:53:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1791917615; bh=F59BhMxzLmIEWGLPVD9QMJcDRlLqFRld+GUxiGHGCw4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=unuDba5954/YPaUuaoCp6WcY6fk3aBNxmTw2eAmeIj+sp1WvaxgdEcKZcbS9JBH3N g6cH6P2jX+ns3CghTkyz7oILbOmz0d5q7gWswNmpqDR+pb75hiQd0RNCaGMixOeBze +08i4AQlaeBTgmETAFzj6Zdd4/sgb25aD74q75ivmw/7B8g/pKYAXl6JUe9qkp2wZV ZQEcdgKw5DjZGNXbbeRXWNi2vFxOavY5AgAsFPNMRn4HQhJRaLY2rUTJwPrI7Rqrk/ /tddNF6xJ/UTrQhajQXpmzW/TDaRcr2KVINCzK2WIRg9RUVaz/jsiJzBNt8r1vU4P5 2Qf0VSA4WepOw== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 02873B00192; Tue, 13 Oct 2026 20:53:35 +0200 (CEST) Date: Tue, 13 Oct 2026 20:53:34 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: =?utf-8?Q?F=C3=A4rber=2C_Franz-Josef_=28StMUK=29?= Cc: "pgsql-general@postgresql.org" Subject: Re: pg_event_trigger_ddl_commands after GRANT is quite empty Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Oct-12, Färber, Franz-Josef (StMUK) wrote: > Dear Postgres Community, > > 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? Yeah, I'm afraid the implementation to expose this to SQL was left incomplete back in 9.5. You can see in EventTriggerCollectGrant() that we do try and collect the information, but in pg_event_trigger_ddl_commands() in event_trigger.c the case for SCT_Grant fills nulls for most columns. The CollectedCommand pointer is present and should contain all details of the grant, though, so as Laurenz says you can get by in the meantime with some C code. Exposing it in SQL (which we're likely to require now that Sawada-san is back at implementing DDL replication) is going to require some additional design for the datatypes and so on. The difference between GRANT and all others is that you affect multiple objects and multiple privileges in a single command, so we cannot just shoehorn an object name in the same place as for the other commands. One weird thing I noticed is that there isn't a single GRANT in the tests in src/test/modules/test_ddl_deparse. But that wouldn't have changed things at all, I'm afraid ... (You could use the code there as a template to implement your own, BTW.) -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/