Calling stored procedures in PostgreSQL

Is it possible to call stored procedures with the PostgreSQL data source?
We’re currently using TimescaleDB to store very high frequency data and would like to query and display as efficiently as possible. Calling procedures might be necessary to create dynamic queries.

A higher time frame should either load a lower resolution (fewer data points from the db) or use windowing functions like moving averages etc.

You can do SELECT procedure(arg1,arg2) not sure if that answers your question. If it returns a resultset it should work. Having tables involved is not required and grafana does not care. Grafana substitutes grafana macros and then passes the query string to postgres.