# PostgreSQL

**URL:** https://community.grafana.com/c/support/postgresql/55.md

[Latest](https://community.grafana.com/latest.md) · [Categories](https://community.grafana.com/categories.md) · [Tags](https://community.grafana.com/tags.md)

---

## [About the PostgreSQL category](https://community.grafana.com/t/about-the-postgresql-category/65117)

<div class="topic-metadata">

**Author:** [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Replies:** 0

</div>

Documentation about: The PostgreSQL Data source:

---

## [Overriding "database" field in panel editor](https://community.grafana.com/t/overriding-database-field-in-panel-editor/164250)

<div class="topic-metadata">

**Author:** [@graydenshand](https://community.grafana.com/u/graydenshand)\
**Replies:** 4\
**Last updated:** [August 26, 2026, 11:17pm UTC](https://community.grafana.com/t/overriding-database-field-in-panel-editor/164250 "2026-08-26T23:17:04Z")

</div>

A postgres server (“cluster”) can have multiple databases; users are defined globally, and the same user can potentially connect to and query multiple databases on the same server. Because of this fact, I find it odd th…

---

## [Current Migration Documentation for sqllite to postgresql](https://community.grafana.com/t/current-migration-documentation-for-sqllite-to-postgresql/164080)

<div class="topic-metadata">

**Author:** [@scootertramp](https://community.grafana.com/u/scootertramp)\
**Replies:** 11\
**Last updated:** [August 13, 2026, 2:07am UTC](https://community.grafana.com/t/current-migration-documentation-for-sqllite-to-postgresql/164080 "2026-08-13T02:07:14Z")

</div>

Looking for an up to date document for migrating sqllite to postgresql. I have tried a couple different methods found here on the forum and from Google searches but all have had some data issues which left a non-workin…

---

## [Add interval variable to postgresql code](https://community.grafana.com/t/add-interval-variable-to-postgresql-code/161353)

<div class="topic-metadata">

**Author:** [@yurarar](https://community.grafana.com/u/yurarar)\
**Replies:** 1\
**Last updated:** [January 27, 2026, 11:06am UTC](https://community.grafana.com/t/add-interval-variable-to-postgresql-code/161353 "2026-01-27T11:06:32Z")

</div>

Hi, everyone! I use Grafana v12.1.0 and postgresql data source. I’m trying to build a time series panel. My code already works but I don’t understand how to add an interval variable. Here is my sql: SELECT “property\_…

---

## [Energy flow diagram using Sankey Panel with data from PostgreSQL](https://community.grafana.com/t/energy-flow-diagram-using-sankey-panel-with-data-from-postgresql/112711)

<div class="topic-metadata">

**Author:** [@kklebowska](https://community.grafana.com/u/kklebowska)\
**Replies:** 5\
**Last updated:** [January 14, 2026, 3:03pm UTC](https://community.grafana.com/t/energy-flow-diagram-using-sankey-panel-with-data-from-postgresql/112711 "2026-01-14T15:03:36Z")

</div>

Hi everyone, I’m using Grafana v10.2.1 on Windows 10 (64-bit) and PostgreSQL database. I’m trying to create Energy Flow Diagram in Sankey using this panel: Sankey Panel plugin for Grafana | Grafana Labs. I’ve tried als…

---

## [Date\_trunc returns wrong timestamp](https://community.grafana.com/t/date-trunc-returns-wrong-timestamp/160674)

<div class="topic-metadata">

**Author:** [@dgeivaerts](https://community.grafana.com/u/dgeivaerts)\
**Replies:** 0\
**Last updated:** [January 1, 2026, 11:33am UTC](https://community.grafana.com/t/date-trunc-returns-wrong-timestamp/160674 "2026-01-01T11:33:50Z")

</div>

What Grafana version and what operating system are you using? Raspberry pi / Grafana v12.3.1 (0d1a5b4420) What are you trying to achieve? retrieve the max of values stored in postgresDB for the current month starting …

---

## [Is Grafana 12 compatible with postgres 17?](https://community.grafana.com/t/is-grafana-12-compatible-with-postgres-17/160301)

<div class="topic-metadata">

**Author:** [@nathanyangwcar](https://community.grafana.com/u/nathanyangwcar)\
**Replies:** 2\
**Last updated:** [December 17, 2025, 6:51am UTC](https://community.grafana.com/t/is-grafana-12-compatible-with-postgres-17/160301 "2025-12-17T06:51:35Z")

</div>

Hi Grafana community, I’m currently running Grafana 12 using the Docker image grafana/grafana:latest-ubuntu, connected to a PostgreSQL 15 database. I’m planning to upgrade the PostgreSQL database to version 17, but I’m…

---

## [Is Grafana compatible with newer versions of Postgres, such as version 17?](https://community.grafana.com/t/is-grafana-compatible-with-newer-versions-of-postgres-such-as-version-17/157667)

<div class="topic-metadata">

**Author:** [@lylecox](https://community.grafana.com/u/lylecox)\
**Replies:** 1\
**Last updated:** [October 7, 2025, 7:17am UTC](https://community.grafana.com/t/is-grafana-compatible-with-newer-versions-of-postgres-such-as-version-17/157667 "2025-10-07T07:17:01Z")

</div>

Has anyone tried to use Grafana with Postgres version 17? I end up using the latest available versions and if Grafana doesn’t keep up, then maybe I need to look for another solution. I am not able to connect to my datab…

---

## [Flux to PostgreSQL derivative unit 1s](https://community.grafana.com/t/flux-to-postgresql-derivative-unit-1s/155719)

<div class="topic-metadata">

**Author:** [@starfoxfs](https://community.grafana.com/u/starfoxfs)\
**Replies:** 2\
**Last updated:** [August 6, 2025, 9:35am UTC](https://community.grafana.com/t/flux-to-postgresql-derivative-unit-1s/155719 "2025-08-06T09:35:37Z")

</div>

Hi, how can i write this “derivative” to Postgresql ? from(bucket: "${bucket}") |\> range(start: v.timeRangeStart, stop: v.timeRangeStop) |\> filter(fn: (r) =\> r\["\_measurement"\] == "kernel") |\> filter(fn: (r) =\> r…

---

## [Show week number and date in X axis (grafana on postgres datasource)](https://community.grafana.com/t/show-week-number-and-date-in-x-axis-grafana-on-postgres-datasource/140006)

<div class="topic-metadata">

**Author:** [@davidjli9731](https://community.grafana.com/u/davidjli9731)\
**Replies:** 2\
**Last updated:** [August 1, 2025, 9:59am UTC](https://community.grafana.com/t/show-week-number-and-date-in-x-axis-grafana-on-postgres-datasource/140006 "2025-08-01T09:59:06Z")

</div>

Hi! I’ve connected to a postgres datasource with Grafana, and I wanted to build a time series out of a table using a line plot, not a bar plot. The table consists of essentially three columns: 1) date\_created (timestamp…

---

## [Latest of Kilowatthours over 24hours counted or sum to 1month Bars?](https://community.grafana.com/t/latest-of-kilowatthours-over-24hours-counted-or-sum-to-1month-bars/155391)

<div class="topic-metadata">

**Author:** [@starfoxfs](https://community.grafana.com/u/starfoxfs)\
**Replies:** 6\
**Last updated:** [July 30, 2025, 4:30pm UTC](https://community.grafana.com/t/latest-of-kilowatthours-over-24hours-counted-or-sum-to-1month-bars/155391 "2025-07-30T16:30:00Z")

</div>

Hi, i think that is the most difficult Query i have in Flux needs to be converted to Postgresql: import "timezone" // Set location to be Europe/Berlin option location = timezone.location(name: "Europe/Berlin") from(bu…

---

## [Display nothing when no Data is in Postgresql](https://community.grafana.com/t/display-nothing-when-no-data-is-in-postgresql/155334)

<div class="topic-metadata">

**Author:** [@starfoxfs](https://community.grafana.com/u/starfoxfs)\
**Replies:** 2\
**Last updated:** [July 29, 2025, 3:03pm UTC](https://community.grafana.com/t/display-nothing-when-no-data-is-in-postgresql/155334 "2025-07-29T15:03:41Z")

</div>

Hi, since i switched form InfluxDB to PostgreSQL i have Data Fields filled with Values that dont exists. e.g.: Here in PostgreSQL over the Night there are no values because WIFI/WLAN is turned off but PostgreSQL fi…

---

## [4 Months Time Series Chart per Month collected?](https://community.grafana.com/t/4-months-time-series-chart-per-month-collected/155200)

<div class="topic-metadata">

**Author:** [@starfoxfs](https://community.grafana.com/u/starfoxfs)\
**Replies:** 5\
**Last updated:** [July 28, 2025, 6:00pm UTC](https://community.grafana.com/t/4-months-time-series-chart-per-month-collected/155200 "2025-07-28T18:00:48Z")

</div>

Hi, i want to make a chart per Month collection of Power Consumption in a Grafana Time Series Visualization. How to make this with Postgresql ? I have one Time Field with timestampz, the value and the sensor Informati…

---

## [Show and filter y axis by day](https://community.grafana.com/t/show-and-filter-y-axis-by-day/115077)

<div class="topic-metadata">

**Author:** [@rolandovargasla](https://community.grafana.com/u/rolandovargasla)\
**Replies:** 2\
**Last updated:** [June 30, 2025, 11:14am UTC](https://community.grafana.com/t/show-and-filter-y-axis-by-day/115077 "2025-06-30T11:14:02Z")

</div>

hi, i have simple table in postgresql tables is name\_variable, date\_time and value… i need show bart chart group by day of month and other bar chart group by moth of year. y used query of sql but it not label i y axis t…

---

## [PosgreSQL 8.3 Connection on Localhost](https://community.grafana.com/t/posgresql-8-3-connection-on-localhost/85299)

<div class="topic-metadata">

**Author:** [@ODT](https://community.grafana.com/u/ODT)\
**Replies:** 1\
**Last updated:** [June 26, 2025, 12:30pm UTC](https://community.grafana.com/t/posgresql-8-3-connection-on-localhost/85299 "2025-06-26T12:30:26Z")

</div>

Hey, I am trying to connect a PostgreSQL database on the same server as grafana enterprise is installed on. Does Grafana support PostgreSQL 8.3? I keep getting an error “Internal Server Error” - new to this so not sure…

---

## [Query on variables to select all column](https://community.grafana.com/t/query-on-variables-to-select-all-column/59738)

<div class="topic-metadata">

**Author:** [@dtorobay](https://community.grafana.com/u/dtorobay)\
**Replies:** 3\
**Last updated:** [June 24, 2025, 2:22pm UTC](https://community.grafana.com/t/query-on-variables-to-select-all-column/59738 "2025-06-24T14:22:06Z")

</div>

I´m trying to create a query based on Postgresql creating a variable that should select all values from the chosen column (temperature, turbidity, dissolved O2, etc ). Is there somekind of example in that case?

---

## [Database is locked error in grafana, database is set to postgresql](https://community.grafana.com/t/database-is-locked-error-in-grafana-database-is-set-to-postgresql/138582)

<div class="topic-metadata">

**Author:** [@ansarizakir](https://community.grafana.com/u/ansarizakir)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 6:15pm UTC](https://community.grafana.com/t/database-is-locked-error-in-grafana-database-is-set-to-postgresql/138582 "2025-06-23T18:15:25Z")

</div>

What Grafana version and what operating system are you using? Version 9.3.6 What are you trying to achieve? I want to get rid of database lock error Can you copy/paste the configuration(s) that you are having p…

---

## [Query with postgresql with json data](https://community.grafana.com/t/query-with-postgresql-with-json-data/87729)

<div class="topic-metadata">

**Author:** [@suporteti8](https://community.grafana.com/u/suporteti8)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 5:26pm UTC](https://community.grafana.com/t/query-with-postgresql-with-json-data/87729 "2025-06-23T17:26:38Z")

</div>

How do I perform a query in postgresql to get data in JOSN? I have tried this way below, but it presents the error: db query error: pq: operator does not exist: text -\>\> unknown SELECT ((old\_data-\>\>‘plano\_id’)::NUMERIC…

---

## [Db query error: pq: relation "\<table\>" does not exist](https://community.grafana.com/t/db-query-error-pq-relation-table-does-not-exist/134216)

<div class="topic-metadata">

**Author:** [@jhall1990](https://community.grafana.com/u/jhall1990)\
**Replies:** 1\
**Last updated:** [June 23, 2025, 11:43am UTC](https://community.grafana.com/t/db-query-error-pq-relation-table-does-not-exist/134216 "2025-06-23T11:43:47Z")

</div>

What Grafana version and what operating system are you using? Grafana v11.2.1 (6291d0d714) What are you trying to achieve? Using postgres as a data source run multiple queries to eventually join into a single tabl…

---

## [Multi-value query variable not working for some queries](https://community.grafana.com/t/multi-value-query-variable-not-working-for-some-queries/152847)

<div class="topic-metadata">

**Author:** [@ebs27](https://community.grafana.com/u/ebs27)\
**Replies:** 1\
**Last updated:** [June 17, 2025, 7:20pm UTC](https://community.grafana.com/t/multi-value-query-variable-not-working-for-some-queries/152847 "2025-06-17T19:20:07Z")

</div>

Hi, I am using variables to plot data from various sensors. I have created two variables for two sensor types (HR and BT) that pull a number of sensor IDs. In the Query variable window, I am able to see (see attachment …

---

## [Unable to create Postgres datasource that connects to RDS Database in VPC](https://community.grafana.com/t/unable-to-create-postgres-datasource-that-connects-to-rds-database-in-vpc/150638)

<div class="topic-metadata">

**Author:** [@irfan14](https://community.grafana.com/u/irfan14)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 8:32pm UTC](https://community.grafana.com/t/unable-to-create-postgres-datasource-that-connects-to-rds-database-in-vpc/150638 "2025-05-16T20:32:13Z")

</div>

I am using the online hosting @ https://hgobs.grafana.net/. I am creating a new datasource to connect to RDS PostGres Proxy which is available in VPC Postgres version that we are using is 17, I have select “15” f…

---

## [How to autozoom graph to data?](https://community.grafana.com/t/how-to-autozoom-graph-to-data/60726)

<div class="topic-metadata">

**Author:** [@szlaurjakub](https://community.grafana.com/u/szlaurjakub)\
**Replies:** 14\
**Last updated:** [March 26, 2025, 2:03am UTC](https://community.grafana.com/t/how-to-autozoom-graph-to-data/60726 "2025-03-26T02:03:58Z")

</div>

Hello everyone, pretty new to Grafana with PostgresSQL and so far I love it! I will be presetting to our company the capabilities of Grafana next week and proposing to switching onto this platform - but I need help with …

---

## [Rapid-fire Postgres times series queries from Grafana](https://community.grafana.com/t/rapid-fire-postgres-times-series-queries-from-grafana/147115)

<div class="topic-metadata">

**Author:** [@walter42](https://community.grafana.com/u/walter42)\
**Replies:** 1\
**Last updated:** [March 26, 2025, 1:07am UTC](https://community.grafana.com/t/rapid-fire-postgres-times-series-queries-from-grafana/147115 "2025-03-26T01:07:10Z")

</div>

Our typical dashboard consists of a number of Postgres queries usually of the form DROP TABLE IF EXISTS mytable; CREATE TEMPORARY TABLE mytable( "date" text, "Forecast (YoY)" DOUBLE PRECISION, "Forecast (M…

---

## [PEM plugin from PostgresSQL on Grafana](https://community.grafana.com/t/pem-plugin-from-postgressql-on-grafana/145202)

<div class="topic-metadata">

**Author:** [@tingjtam](https://community.grafana.com/u/tingjtam)\
**Replies:** 3\
**Last updated:** [March 7, 2025, 4:20am UTC](https://community.grafana.com/t/pem-plugin-from-postgressql-on-grafana/145202 "2025-03-07T04:20:11Z")

</div>

Is there any way to use metric from PEM for PostgresSQL on Grafana, instead of using Prometheus? Thanks.

---

## [Write a row in PostgreSQL with Business Forms Plugin](https://community.grafana.com/t/write-a-row-in-postgresql-with-business-forms-plugin/126654)

<div class="topic-metadata">

**Author:** [@SunrakuBzh](https://community.grafana.com/u/SunrakuBzh)\
**Replies:** 5\
**Last updated:** [February 14, 2025, 1:46pm UTC](https://community.grafana.com/t/write-a-row-in-postgresql-with-business-forms-plugin/126654 "2025-02-14T13:46:21Z")

</div>

Hello I am trying to write a row in my postgreSQL database from Grafana with “business forms plugin” but there is no simple example explained What Grafana version and what operating system are you using? 10 / 11 W…

---

## [Issue with timezone](https://community.grafana.com/t/issue-with-timezone/141213)

<div class="topic-metadata">

**Author:** [@johanvier](https://community.grafana.com/u/johanvier)\
**Replies:** 7\
**Last updated:** [January 25, 2025, 4:27pm UTC](https://community.grafana.com/t/issue-with-timezone/141213 "2025-01-25T16:27:40Z")

</div>

Hi, I am facing this issue: In node red, I have a payload with this value: timestamp: “2025-01-25 15:29:27” (this is the correct local datetime with daylight saving time), which I insert in a PostgreSQL database. In th…

---

## [Grafana 10.2.3 - Postgres 16.3 and errors with too many connections - too many clients already](https://community.grafana.com/t/grafana-10-2-3-postgres-16-3-and-errors-with-too-many-connections-too-many-clients-already/140632)

<div class="topic-metadata">

**Author:** [@kkocel20](https://community.grafana.com/u/kkocel20)\
**Replies:** 3\
**Last updated:** [January 23, 2025, 11:01am UTC](https://community.grafana.com/t/grafana-10-2-3-postgres-16-3-and-errors-with-too-many-connections-too-many-clients-already/140632 "2025-01-23T11:01:50Z")

</div>

I noticed datasources errors in Grafana. When looking at the Grafana logs, I saw many errors like: annotationruleID1dashactualerrorstrconv.ParseInt: parsing "": invalid ...level=error msg="Failed to save alert state" ..…

---

## [How to visualize percentage threshold relative to the average value](https://community.grafana.com/t/how-to-visualize-percentage-threshold-relative-to-the-average-value/140032)

<div class="topic-metadata">

**Author:** [@infofcc3](https://community.grafana.com/u/infofcc3)\
**Replies:** 0\
**Last updated:** [January 11, 2025, 7:02pm UTC](https://community.grafana.com/t/how-to-visualize-percentage-threshold-relative-to-the-average-value/140032 "2025-01-11T19:02:17Z")

</div>

Problem statement: Dynamic Highlighting of Metrics in Grafana Based on Conditions You are tasked with creating a Grafana visualization for monitoring metrics stored in a PostgreSQL database. The metrics represent variou…

---

## [Grafana Postgres Connectivity](https://community.grafana.com/t/grafana-postgres-connectivity/139702)

<div class="topic-metadata">

**Author:** [@manideepramini](https://community.grafana.com/u/manideepramini)\
**Replies:** 1\
**Last updated:** [January 7, 2025, 9:49am UTC](https://community.grafana.com/t/grafana-postgres-connectivity/139702 "2025-01-07T09:49:20Z")

</div>

Hi Team , We are using Grafana 6.2 Version and One of the Application team is using Postgres 13.3 Version where as data is reporting to grafana and they have upgraded their postgres db to 16 version post that we are una…

---

## [Will Grafana 6.2 Support Postgres 16 Version](https://community.grafana.com/t/will-grafana-6-2-support-postgres-16-version/139651)

<div class="topic-metadata">

**Author:** [@manideepramini](https://community.grafana.com/u/manideepramini)\
**Replies:** 1\
**Last updated:** [January 6, 2025, 3:19pm UTC](https://community.grafana.com/t/will-grafana-6-2-support-postgres-16-version/139651 "2025-01-06T15:19:22Z")

</div>

Hi All, I would want to know will grafana 6.2 Version will support postgres 16 version.

[Next page](https://community.grafana.com/c/support/postgresql/55.md?page=1)
