1

I have this query :

SELECT SUM(median) FROM my_table WHERE id = 100
-- median is of type float4

When I run from psql, it returns slightly different result for multiple of runs (For example 1000.08, 1001.02, ...)

The number of entries contributing to the query is about 100K.

But when I run the query with SQL Editor of DBeaver (https://dbeaver.io/), I get same result consistently when I run multiple times.

Is there a way to configure psql so that I get same result as DBeaver ?

Philippe
  • 125
  • 5
  • This may be related: https://github.com/dbeaver/dbeaver/issues/6466 check the DBeaver to see if you've got auto-sync with navigator option enabled – Vomit IT - Chunky Mess Style Dec 03 '22 at 01:43
  • @VomitIT-ChunkyMessStyle Thanks for commenting! I'm 100% certain the table is not getting additional rows between the runs of the queries. As I have done 5 times psql, followed by 5 times DBeaver, followed 5 times psql again. DBeaver returned consistent result whereas psql returns different results in both runs. – Philippe Dec 03 '22 at 17:36
  • Do you have auto-sync turned on per that comment link, or does anything with that sound applicable? See if any of these options https://www.postgresql.org/docs/current/app-psql.html listed see if they'd turn on anything with the terminal psql to make it work like the dbeaver program. – Vomit IT - Chunky Mess Style Dec 04 '22 at 01:23

0 Answers0