Implicitly created operator family not listed by pg_event_trigger_ddl_commands
LEMAIRE Leslie - SG/DNUM/UNI/DRC (Chargée de mission) <leslie.lemaire@developpement-durable.gouv.fr>
From: LEMAIRE Leslie (Chargée de mission) - SG/SNUM/UNI/DRC <leslie.lemaire@developpement-durable.gouv.fr>
To: pgsql-bugs@lists.postgresql.org
Date: 2022-05-02T11:27:20Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix DDL deparse of CREATE OPERATOR CLASS
- 70f70d7d3f58 10.22 landed
- 6c6ea6ea81eb 11.17 landed
- 6029861916e8 15.0 landed
- 58b088a9b3c2 14.4 landed
- 4492e73a66bf 12.12 landed
- 3753a169e110 13.8 landed
-
Backpatch regression tests added by 2d689babe3cb
- fa51cc86c684 10.22 landed
- daf015fd0c1d 11.17 landed
- ac78cec9811b 12.12 landed
- 99867e727722 13.8 landed
Hi, I have an event trigger firing at command end on "CREATE OPERATOR CLASS", "CREATE OPERATOR FAMILY" and every other creation command of schema dependent objects. As stated in the documentation [1], creating an operator class without specifying the FAMILY option will create an operator family with the same name as the new class if it doesn't already exist. In this case, my event trigger is activated through the "CREATE OPERATOR CLASS" tag as usual, but pg_event_trigger_ddl_commands() still returns only one row - for the operator class creation. I would have expected it to list the creation of the operator family as well. Since event triggers don't catch implicit commands [2], the "CREATE OPERATOR FAMILY" tag is useless here and the operator family creation is never detected. I observed this with PostgreSQL 14.2 (Windows 10, Visual C++ build 1914, 64-bit) and PostgreSQL 10.12 (Windows 10, Visual C++ build 1800, 64-bit), so it's likely not a version specific issue. The documentation doesn't say much about pg_event_trigger_ddl_commands() [3], but I would assume it's meant to be as exhaustive as possible, hence this bug report. By comparison, with an event trigger firing at command end on "CREATE TABLE" and a command such as "CREATE TABLE my_table (id serial PRIMARY KEY)", pg_event_trigger_ddl_commands() would return four rows, including the sequence creation and the index creation. Thanks in advance and sorry if I'm just missing something here. Regards, [1] https://www.postgresql.org/docs/14/sql-createopclass.html [2] I don't think it's documented anywhere, but this seems to be a consistant behaviour and it makes sense as long as pg_event_trigger_ddl_commands() does the work. [3] https://www.postgresql.org/docs/14/functions-event-triggers.html -- Leslie Lemaire Secrétariat général des ministères de la transition écologique, de la cohésion des territoires et de la mer Service du numérique