Grafana's datasource provisioning for PostgreSQL accepts a postgresVersion field inside jsonData. This is a Grafana-internal integer that encodes the PostgreSQL server version — for example 903 for v9.3, 906 for v9.6, 1000 for v10, 1500 for v15, 1800 for v18.
In helm/pgwatch/templates/grafana-deployment.yaml, the grafana-datasources ConfigMap handles two backend scenarios:
-
create_metric_database: "true" (built-in PostgreSQL StatefulSet):
postgresVersion is hardcoded to 1800 (in the kubernetes-ready-pgwatch branch)
-
use_existing_database (user-provided external PostgreSQL instance):
postgresVersion is not set at all. Grafana falls back to its internal default, which may not reflect the actual server version.
The same ConfigMap is used when the Grafana subchart (pgwatch.grafana.useSubchart: true) is active — the grafana_datasource: "1" label causes the k8s-sidecar to pick it up, so both Grafana deployment modes are affected.
The TimescaleDB subchart path (timescaledb.enabled: true) is equally affected: no postgresVersion is set for that case either.
There should be a better way to handle this parameter, instead of hardcoding it.
Grafana's datasource provisioning for PostgreSQL accepts a
postgresVersionfield insidejsonData. This is a Grafana-internal integer that encodes the PostgreSQL server version — for example903for v9.3,906for v9.6,1000for v10,1500for v15,1800for v18.In helm/pgwatch/templates/grafana-deployment.yaml, the
grafana-datasourcesConfigMap handles two backend scenarios:create_metric_database: "true"(built-in PostgreSQL StatefulSet):postgresVersionis hardcoded to1800(in thekubernetes-ready-pgwatchbranch)use_existing_database(user-provided external PostgreSQL instance):postgresVersionis not set at all. Grafana falls back to its internal default, which may not reflect the actual server version.The same ConfigMap is used when the Grafana subchart (
pgwatch.grafana.useSubchart: true) is active — thegrafana_datasource: "1"label causes the k8s-sidecar to pick it up, so both Grafana deployment modes are affected.The TimescaleDB subchart path (
timescaledb.enabled: true) is equally affected: nopostgresVersionis set for that case either.There should be a better way to handle this parameter, instead of hardcoding it.