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
However, I get the following error when running the query above:
PostgreSQLSeverity.error 22003: value "1640556171599" is out of range for type integer
package:postgres/src/connection.dart 453:18 _PostgreSQLExecutionContextMixin._query
package:postgres/src/connection.dart 427:7 _PostgreSQLExecutionContextMixin.query
I attempted to remedy by specifying the data type in the query, like so:
In theory we should have full int8 support both in Dart and in package:postgres. We should have a test or two that uses it as input and output for a query, but I don't recall the details right away. If you have some time, please debug it a bit more, I'm happy to accept PRs...
Dart
ints
are 64-bit, so I assumed this would work:await connection.query("SELECT TO_TIMESTAMP(@ts / 1000)", substitutionValues: {'ts': 1640556171599});
However, I get the following error when running the query above:
I attempted to remedy by specifying the data type in the query, like so:
await connection.query("SELECT TO_TIMESTAMP(@ts:int8 / 1000)", substitutionValues: {'ts': 1640556171599});
This causes a different error:
Is this a bug or am I mistaken on how to safely use 64-bit
ints
as query parameters?The text was updated successfully, but these errors were encountered: