You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
version float4,
releaseurl varchar(128),
releaseinfo varchar(128),
timestamp int4,
where version is the primary key.
I use this select request to fetch the latest version SELECT version, releaseinfo, timestamp FROM ... ORDER BY version DESC LIMIT 1
it returns me 3.0999999046325684 in asyncpg python.
yet the database has no such value, I was guessing perhaps a precision error on that and it was getting 3.1.
Cuz the database does have 3.1 and when i use the same query on java JDBC, it does return 3.1
The text was updated successfully, but these errors were encountered:
Try casting to decimal in your query, see if it changes.
On a side-note, though related if I understand your table correctly, I'd suggest using a fixed-length array of integers for version numbers. Even if you're absolutely sure you'll never have values like 3.14.2, a version number is not a float (or a decimal). And comparison becomes natural with an array of ints:
I have this postgres table:
where version is the primary key.
I use this select request to fetch the latest version
SELECT version, releaseinfo, timestamp FROM ... ORDER BY version DESC LIMIT 1
it returns me
3.0999999046325684
in asyncpg python.yet the database has no such value, I was guessing perhaps a precision error on that and it was getting
3.1
.Cuz the database does have
3.1
and when i use the same query on java JDBC, it does return3.1
The text was updated successfully, but these errors were encountered: