BUG #19637: pg_event_trigger_ddl_commands can't process GRANT ON PROPERTY GRAPH
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
This thread has been committed, so CI has stopped here. Anything below is the last result it produced.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253527psql -h localhost -U postgresBuilt from patchset v6 (message #6), August 27, 2026 at 03:41 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t253527_6 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t253527_6 && git checkout t253527_6Patchset v6 (message #6) is on t253527_6
The following bug has been logged on the website:
Bug reference: 19637
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 19beta3
Operating system: Ubuntu 24.04
Description:
The following script:
CREATE OR REPLACE FUNCTION event_trigger_report_end()
RETURNS event_trigger
LANGUAGE plpgsql
AS $$
DECLARE r RECORD;
BEGIN
FOR r IN SELECT * FROM pg_event_trigger_ddl_commands()
LOOP
RAISE NOTICE 'END: command_tag=% type=% identity=%',
r.command_tag, r.object_type, r.object_identity;
END LOOP;
END; $$;
CREATE EVENT TRIGGER regress_event_trigger_report_end ON ddl_command_end
EXECUTE PROCEDURE event_trigger_report_end();
CREATE PROPERTY GRAPH pg;
GRANT SELECT ON PROPERTY GRAPH pg TO public;
fails with:
ERROR: XX000: unsupported object type: 30
CONTEXT: PL/pgSQL function event_trigger_report_end() line 4 at FOR over
SELECT rows
LOCATION: stringify_grant_objtype, event_trigger.c:2335
Reproduced starting from 2f094e7ac.
пн, 24 авг. 2026 г. в 17:16, PG Bug reporting form <noreply@postgresql.org>:
The following bug has been logged on the website:
Bug reference: 19637
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 19beta3
Operating system: Ubuntu 24.04
Description:The following script:
CREATE OR REPLACE FUNCTION event_trigger_report_end()
RETURNS event_trigger
LANGUAGE plpgsql
AS $$
DECLARE r RECORD;
BEGIN
FOR r IN SELECT * FROM pg_event_trigger_ddl_commands()
LOOP
RAISE NOTICE 'END: command_tag=% type=% identity=%',
r.command_tag, r.object_type, r.object_identity;
END LOOP;
END; $$;
CREATE EVENT TRIGGER regress_event_trigger_report_end ON ddl_command_end
EXECUTE PROCEDURE event_trigger_report_end();CREATE PROPERTY GRAPH pg;
GRANT SELECT ON PROPERTY GRAPH pg TO public;fails with:
ERROR: XX000: unsupported object type: 30
CONTEXT: PL/pgSQL function event_trigger_report_end() line 4 at FOR over
SELECT rows
LOCATION: stringify_grant_objtype, event_trigger.c:2335Reproduced starting from 2f094e7ac.
Dear Alexander,
Thanks for the report.
This is a leftover from commit 2f094e7ac
The fix returns "PROPERTY GRAPH", matching the GRANT command spelling.
--
Regards,
Rachitskiy Andrey
Does this one deserve a mention on the open items wiki [0]https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items?
[0]: https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items
--
nathan
ср, 26 авг. 2026 г. в 00:28, Nathan Bossart <nathandbossart@gmail.com>:
Does this one deserve a mention on the open items wiki [0]?
[0] https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items
Dear Nathan,
I think we can add that.
--
Regards,
Rachitskiy Andrey
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
ср, 26 авг. 2026 г. в 05:50, Fujii Masao <masao.fujii@gmail.com>:
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.Dear Fujii-san,
Thanks for the review.
Agreed, it's better this way.
fix in v2.
--
Regards,
Rachitskiy Andrey
On 26.08.26 05:08, Andrey Rachitskiy wrote:
ср, 26 авг. 2026 г. в 05:50, Fujii Masao <masao.fujii@gmail.com
<mailto:masao.fujii@gmail.com>>: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.Dear Fujii-san,
Thanks for the review.
Agreed, it's better this way.
fix in v2.
committed