PostgreSQL Connection

Host
Database
User
This option determines whether or with what priority a secure SSL (TLS) TCP/IP connection will be negotiated with the server.
SSL Root Certificate If the selected SSL mode requires a server root certificate, provide the path to the file here. Be sure that the file is readable by the user executing the grafana process.
SSL Client Certificate To authenticate with an SSL/TLS client certificate, provide the path to the file here. Be sure that the file is readable by the user executing the grafana process.
SSL Client Key To authenticate with a client SSL/TLS certificate, provide the path to the corresponding key file here. Be sure that the file is only readable by the user executing the grafana process.
Connection limits
Max open The maximum number of open connections to the database. If Max idle connections is greater than 0 and the Max open connections is less than Max idle connections, then Max idle connections will be reduced to match the Max open connections limit. If set to 0, there is no limit on the number of open connections.
Max idle The maximum number of connections in the idle connection pool. If Max open connections is greater than 0 but less than the Max idle connections, then the Max idle connections will be reduced to match the Max open connections limit. If set to 0, no idle connections are retained.
Max lifetime The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.

PostgreSQL details

Version This option controls what functions are available in the PostgreSQL query builder.
Min time interval A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example 1m if your data is written every minute.

TimescaleDB is a time-series database built as a PostgreSQL extension. If enabled, Grafana will use time_bucket in the $__timeGroup macro and display TimescaleDB specific aggregate functions in the query builder.

User Permission

The database user should only be granted SELECT permissions on the specified database & tables you want to query. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements like DELETE FROM user; and DROP TABLE user; would be executed. To protect against this we Highly recommmend you create a specific PostgreSQL user with restricted permissions.