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.

UInt64 and Npgsql

See original GitHub issue

When using BulkInsertAsync, I’m seeing this error:

System.InvalidCastException: 'Can't write CLR type System.UInt64 with handler type NumericHandler'

When using BulkCopyAsync I get an index of of range exception. I’m guessing these errors have the same source. I am using Npgsql. EF Core 5.0 is creating rows for my ulong of type Numeric with precision 20, scale 0, and dimensions 0.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rojicommented, Feb 4, 2022

@douglasg14b yeah, that’s an EF Core value converter - that’s expected, no need for an issue. That’s all happening at the EF Core layer, not at the ADO.NET driver layer.

0reactions
douglasg14bcommented, Feb 4, 2022

@roji Gotcha, I’m using this via EF Core, looks like it translates a ulong to h3index numeric(20,0) NOT NULL,.

If that it not expected there, then I can make an issue yeah.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UInt64 and Npgsql · Issue #2624 · linq2db/ ...
I am using Npgsql. EF Core 5.0 is creating rows for my ulong of type Numeric with precision 20, scale 0, and dimensions...
Read more >
Supported Types and their Mappings
Supported Types and their Mappings. The following lists the built-in mappings when reading and writing CLR types to PostgreSQL types.
Read more >
Postgres: data types - How to store uint64 in postresql
@IvanVoras In my case, I am parsing data from binary packets. The field I'm storing is allocated exactly 8 bytes and is encoded...
Read more >
PostgreSQL Types
binary: the 16 bytes txid_snapshot: (txid is a UInt64) A struct of UInt32 nxip (size of the xip array) txid xmin (no values...
Read more >
Storing uint64 values in DB
What's the proper way to cast my uint64 as database signed integer and back safely in Go? Let's use 8-bit variable as example,...
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