-
-
Notifications
You must be signed in to change notification settings - Fork 43
Added bit and bit varying types #2158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Hydrocharged
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type implementations require a bit more diligence with checking Postgres documentation and behavior compared to other feature inclusions. There are a lot of delicate rules that we need to follow that can cause hard-to-debug bugs if we're incorrect in a seemingly unrelated way (such as function overload selection). I'll approve assuming this'll all get updated correctly.
testing/go/types_test.go
Outdated
| Expected: []sql.Row{ | ||
| {1, []byte{0xDA}}, | ||
| {2, []byte{0x2B}}, | ||
| // TODO: the pg library is interpreting the bit string `101` as `a0` (right-padded with zeroes) instead of `05`, not sure if that's correct or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can verify if it's correct by connecting it to your local Postgres database and inserting the same query, which we should technically be doing for all of these kinds of queries if we're ever unsure. This should be tested before merging in case it's broken for this case, as bad data is harder to fix once it's in the wild.
Fixes #2149