question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong numeric value displayed in Grid but correct in Text output

See original GitHub issue

Description

When I select a column of data type REAL (float4) in Postgres, I get to see a value in the Grid output that is not the correct value from the database. It appears as if the value has been rounded and several fractions have been added:

image

When checking the Text output, the value is displayed correctly:

image

Interestingly, the same value is present in the Grid when I double-click into the value:

image

–> double click:

image

DBeaver Version

Community Edition Version 22.2.5.202211202223

Operating System

macOS Ventura 13.0.1

Database and driver

  1. Database name and version: PostgreSQL 15.0 (Debian 15.0-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  2. Database driver: standard Postgres driver as downloaded from DBeaver: image

Steps to reproduce

CREATE TABLE foo (test real);
INSERT INTO foo VALUES (617.6);
SELECT * FROM foo;

Additional context

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ShadelessFoxcommented, Dec 9, 2022

PostgreSQL returns a result set with a single column whose type has no bounds on its precision. When DBeaver displays its value, it checks its precision and formats it accordingly by exposing all these weird digits thanks to the rounding errors.

It looks like the editor, when opened, receives another value that wasn’t formatted. Perhaps we need to look into that.

0reactions
gvenzlcommented, Dec 9, 2022

Given that the right value is there when you double-click on it, I think it’s more like DBeaver works… 😃 I appreciate that it takes the value and converts it into a float for display, but the correct value is there in the grid. I just can’t see why you would run through the conversion at that stage but then again, I don’t know what the option is really good for, to begin with. Anyway, thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show Values field in Text field output, with correct number ...
The logic part is of no issue, but i am having trouble with the Values fields. The output i am looking to create...
Read more >
free-jqGrid - The numeric value is displayed instead of the text ...
When i am in edit, they are displayed correctly but after the row gets saved the dynamicly filled select displays the numeric value...
Read more >
GetCellDisplayText method returning wrong output
Hi DevExpress,. I am trying to catch current Display Text in GridControl's cell using GetCellDisplayText method. Here for numeric column i ...
Read more >
Format a number or currency field - Microsoft Support
When the field contains a value of zero, 0,000.00 is displayed. To display text instead of a number, use "Zero" (surrounded by double...
Read more >
7 Ways to Convert Text to Numbers in Microsoft Excel
Even though the data looks like a number, it can actually be a text value and ... Any cells that are flagged with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found