Re: BUG #19637: pg_event_trigger_ddl_commands can't process GRANT ON PROPERTY GRAPH - Mailing list pgsql-bugs

From Fujii Masao
Subject Re: BUG #19637: pg_event_trigger_ddl_commands can't process GRANT ON PROPERTY GRAPH
Date
Msg-id CAHGQGwH_uiUXf5X8s0Prrn+z-YtSz6tF7GE2QogH=UK0tyEyNw@mail.gmail.com
Whole thread
In response to BUG #19637: pg_event_trigger_ddl_commands can't process GRANT ON PROPERTY GRAPH  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Mon, Aug 24, 2026 at 10:30 PM Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> This is a leftover from commit 2f094e7ac
> The fix returns "PROPERTY GRAPH", matching the GRANT command spelling.

Thanks for the patch!

The code change looks good to me.

Regarding the test, how about simplifying it by reusing the existing
event_trigger_report_end() trigger instead of adding a new event
trigger function just for this case? We could also reuse the property
graph created earlier in event_trigger.sql. This would keep the added
test smaller and fit better with the existing tests.

For example,

----------------------------------------------------------------------------
diff --git a/src/test/regress/sql/event_trigger.sql
b/src/test/regress/sql/event_trigger.sql
index d0e6ba295fe..bbdac7db984 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -155,8 +155,6 @@ CREATE PROPERTY GRAPH gx
   EDGE TABLES (te1 SOURCE tv1 DESTINATION tv2 LABEL e1 PROPERTIES (q as p1));

 ALTER PROPERTY GRAPH gx ALTER EDGE TABLE te1 ALTER LABEL e1 DROP
PROPERTIES (p1);
-DROP PROPERTY GRAPH gx;
-DROP TABLE tv1, tv2, te1;

 -- alter owner to non-superuser should fail
 alter event trigger regress_event_trigger owner to regress_evt_user;
@@ -335,6 +333,12 @@ END; $$;
 CREATE EVENT TRIGGER regress_event_trigger_report_end ON ddl_command_end
   EXECUTE PROCEDURE event_trigger_report_end();

+-- GRANT/REVOKE ON PROPERTY GRAPH with pg_event_trigger_ddl_commands()
+GRANT SELECT ON PROPERTY GRAPH gx TO public;
+REVOKE SELECT ON PROPERTY GRAPH gx FROM public;
+DROP PROPERTY GRAPH gx;
+DROP TABLE tv1, tv2, te1;
+
 CREATE SCHEMA evttrig
        CREATE TABLE one (col_a SERIAL PRIMARY KEY, col_b text DEFAULT
'forty two', col_c SERIAL)
        CREATE INDEX one_idx ON one (col_b)
----------------------------------------------------------------------------

Regards,

--
Fujii Masao



Attachment

pgsql-bugs by date:

Previous
From: Fujii Masao
Date:
Subject: Re: repack with verbose output: not showing the number of removable row versions when using USING INDEX or CONCURRENTLY option
Next
From: Jochen Bandhauer
Date:
Subject: Fwd: Re: repack with verbose output: not showing the number of removable row versions when using USING INDEX or CONCURRENTLY option