As a followup, we created this additional patch removing now-redundant sql templates. If you're interested in how we decided what files to delete, the script we used is
here. We only removed files that were exactly identical between multiple postgres versions for the same feature.
This patch should be applied on a master patched with version-aware-sql-template-loader-refactor.diff