On Sun, Oct 26, 2025 at 2:48 AM Jim Jones <[email protected]> wrote: > > On 23/10/2025 00:27, Philip Alger wrote: > > It might be advantageous to show a `trigger name cannot be schema > > qualified` error to the user. Therefore, I added the check and the tests > > on v8 attached. > > > > postgres=# SELECT pg_get_trigger_ddl('main_table', 'public.modified_a'); > > ERROR: trigger name cannot be schema qualified > > I'm not sure this is the way to go here. Why specifically check for a > schema qualified trigger if it cannot be created in the first place? The > current error message for "trigger not found" would IMHO suffice, e.g. > > ERROR: trigger "s.tr" for table "t" does not exist > hi.
https://www.postgresql.org/docs/current/sql-createtrigger.html says: <<< The name cannot be schema-qualified — the trigger inherits the schema of its table. <<< SELECT pg_get_trigger_ddl('main_table', 'public.modified_a'); should error out, I think. but V7 will not error out, instead it will ignore text "public" and print out DDL for the trigger name as "modified_a" which is not what I expected, so I raised the question. The error message can be different, but it should error out. I am fine with v8. ERROR: trigger name cannot be schema qualified I’m fine with changing it to the other error message: ERROR: trigger name \"%s\" for table \"%s\" does not exist
