Is it possible to get decimals from PostgreSQL?

Hi Guys!

I’m setting up a new dashboard in Grafana, and want to get datas from postgresql.

I am using Postgresql 10 and Grafana 6.1.6. In the database I have three column, id (bigserial), time (timestamp), temp (float4).

I tried this query:
SELECT
time AS “time”,
CAST(temp AS integer)
FROM home_weather.datas
ORDER BY 1

But I need to get with decimals. Is there any option to do that or I simply can’t ?

The reason you are not seeing any decimal places is because you have cast temp to be an integer. Remove the cast and it should work.

1 Like

It’s working.
I am very confused now, I think I tried this before but…

Anyway, thanks for your help :slight_smile: