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
We have a table whose columns were created as unsigned integers, which we had originally expected to be a 4 byte unsigned integer. At the time, I don't think we realized that postgres doesn't support unsigned integers. Only now upon trying to insert a value > (2^31) - 1 did I realize that the real column data type is a signed integer.
I'm not sure if this is documented behavior where sea-query will silently use signed integers under the hood if using Postgres. Have you considered making the use of unsigned integers prohibited if using postgres? Maybe it could be put behind a feature flag, or some other compile time check? This is unfortunately now a pain for us to change so we can use higher value u32s.
Poking around, it seems we're not the first to need to hack around this #275 (comment)
Steps to Reproduce
Create a table with a column ColumnDef::new(Foo::Bar).unsigned() using postgres under the hood
\d my_table, which uses a normal integer
Expected Behavior
Would've expected to not be able to create an unsigned integer, or some assurances about the number range I can use
thank you :) to be transparent, I don't believe I'll have the bandwidth to contribute this, but I'd love to see this happen. In the meantime we'll likely migrate to some larger data types
Description
Hi!
We have a table whose columns were created as unsigned integers, which we had originally expected to be a 4 byte unsigned integer. At the time, I don't think we realized that postgres doesn't support unsigned integers. Only now upon trying to insert a value >
(2^31) - 1
did I realize that the real column data type is a signed integer.I'm not sure if this is documented behavior where sea-query will silently use signed integers under the hood if using Postgres. Have you considered making the use of unsigned integers prohibited if using postgres? Maybe it could be put behind a feature flag, or some other compile time check? This is unfortunately now a pain for us to change so we can use higher value u32s.
Poking around, it seems we're not the first to need to hack around this #275 (comment)
Steps to Reproduce
ColumnDef::new(Foo::Bar).unsigned()
using postgres under the hood\d my_table
, which uses a normal integerExpected Behavior
Would've expected to not be able to create an unsigned integer, or some assurances about the number range I can use
Actual Behavior
uses a signed integer under the hood
Reproduces How Often
every time w/ postgres
Versions
db: PostgreSQL 14
Additional Information
The text was updated successfully, but these errors were encountered: