Hello there,
I've encountered this error while trying to add a TimescaleDB (Postgres) datasource to Postgres:
Pq: function time_bucket(unknown, timestamp without time zone) does not exist
There is no solution online, so I've decided to post mine here. I hope that it finds you well
The solution is to recreate a new user. Then, you can grant the following permissions:
CREATE USER grafana_datasource WITH LOGIN PASSWORD 'your_supersecret_password';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana_datasource;
GRANT USAGE ON SCHEMA public TO grafana_datasource;
-- I am not sure if the two below are really necessary, so feel free to try without it and leave a comment for others
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO grafana_datasource;
GRANT EXECUTE ON ALL PROCEDURES IN SCHEMA public TO grafana_datasource;
The next time that you find an undocumented error online, don't hesitate to post it as a private gist. This is a passive karma income idea that you can start today! (make sure to publish your gist as public or it won't get picked up by Google)