MichaelDBA/pg_get_tabledef

Only the first trigger is shown when there are multiple triggers on a table

alaister opened this issue · 2 comments

If you run the following SQL:

create table public.my_table (
  id bigint generated by default as identity,
  constraint my_table_pkey primary key (id)
);

create trigger my_trigger_one
after insert on my_table for each row
execute function my_func_one();

create trigger my_trigger_two
after insert on my_table for each row
execute function my_func_two();

The definition shown is:

create table public.my_table (
  id bigint generated by default as identity,
  constraint my_table_pkey primary key (id)
) tablespace pg_default;

create trigger my_trigger_one
after insert on my_table for each row
execute function my_func_one ();

my_trigger_two is missing here.

Thanks for your work on this function 🙌🏻

Fixed. @alaister, please test with the latest code.

Thanks, @MichaelDBA! I can confirm it's now working as expected 😃