Custom SQL functions for data analytics in PostgreSQL
timescale.com
timescale.com
My only complaint is that for a few realistic use cases (e.g. zero-copy aggregates with variable-sized memory) there is no documentation how to do this efficiently and "correctly".
If the extension availability is the main concern, I'd recommend the open source StackGres [1] operator, which has, possibly, the largest Postgres extension catalog [2] available.
[1] https://stackgres.io [2] https://stackgres.io/extensions/
Disclaimer: founder of OnGres, the company behind StackGres
Either don't use arbitrarily size-restricted code blocks, or manually format your code so it's legible in the window size you've chosen.