Skip to content

Conversation

@ponychicken
Copy link
Contributor

@ponychicken ponychicken commented Sep 29, 2025

Addresses #56

Partitions of tables are not considered when looking for additional triggers or cleaning them up (is handled by PG through the root table)

@cheerfulstoic cheerfulstoic merged commit 5639bcd into cheerfulstoic:main Sep 29, 2025
1 check passed
@cheerfulstoic
Copy link
Owner

Thanks very much!

I modified the query to use joins because that seemed cleaner to me. More importantly, perhaps, is that I changed the tests to CREATE OR REPLACE TRIGGER on partitioned_root instead of partitioned_part1 because you would be (if I'm thinking about this right) putting the ecto_watch watcher on the partition root and therefore adding / removing triggers via that root table, which as you shared causes the partitioned tables to add triggers. The documentation didn't seem to say if a trigger is dropped from the root that the trigger is dropped from the partitions, but I just tested and it seems that is the case.

Please have a look at the most recent commit and, if it looks good, I'll release a new version:

b0c892a

@ponychicken
Copy link
Contributor Author

Yes, you are right it makes more sense to install the test trigger on the root table and check that there is no warning about the partition trigger. I ran your new query on the DB here and it correctly returns the root trigger but not the partition triggers.

@ponychicken
Copy link
Contributor Author

And yes, I observe the same behaviour, when I delete the root trigger the partition triggers are gone as well. (PG17)

@cheerfulstoic
Copy link
Owner

Released as 0.15.0, thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants