Postgres Transaction OOM on 100k DDL statements
A better idea entirely is to use SQL Server FDW which actually has the logic to pull in Microsoft SQL Server into PostgreSQL format (for example, Bit gets mapped to Bool). From this point

Then every three minutes,


you import the foreign schema into last_fetch_schema
if the last_fetch_schema is different from local_schema


you resync schemas

you copy all of the data over with a INSERT INTO ... SELECT ON CONFLICT DO UPDATE, and you can select only the newest data.
you drop the foreign schema last_fetch_schema


What do you gain?


On first load, you can simply use CREATE TABLE local.foo ( LIKE foreign.foo)
You can easily compare meta-data differences
CSVs loses types and leave you to infer things, FDW can read meta-data catalog.
Grabbing only the newest stuff is very simply if the rows are versioned/ you don't have to send the entire database anymore.