I'm writing docs for https://questdb.io/ which offers SQL-based analytics for time series. We have quite a few users already who use us for ML applications that rely on performance.
Instead of writing an MQTT -> PostgreSQL bridge, you could use Telegraf to listen to MQTT topics and write data to QuestDB over InfluxDB line protocol when it meets certain criteria. One of our users shared the tooling they use in industrial IoT and a tutorial here for exactly this use case: https://questdb.io/tutorial/2020/08/25/questitto/#stack