How to make lots of tables have the same columns as a template?

In PostgreSQL I have tables to store many millions of rows, with over 90 columns. I have under 100 of these, but when I add or adjust a column in the template “d_template” table, I have to manually change them all-and they are growing. The working tables all have a prefix of “d_”, which has it’s own challenges, as the underscore character “_” is seen on some platforms as a variable/wildcard. Add to this that SQL treats a “_” differently than pl/pgsql… I’m using JDBC/Postgresql.

I wanted to run a single function with the template table hard-coded, and have it do the following: