-
Notifications
You must be signed in to change notification settings - Fork 853
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
cannot scan timestamp (OID 1114) in binary format into *string #2118
Comments
Here are some things you could try in rough order of difficulty:
|
Just ran into it, and somehow got it working. type SomeObject struct {
OID pgtype.Int8 `json:"oid"`
} Now |
@hmoazzem I don't see how that code relates to scanning a binary |
Maybe after looking at several issues I lost track of relevance. I was getting error scanning OID field, so searched and looked at many issues with OID in title Anyway, what go data type would you (recommend to) use for OID? |
@hmoazzem |
Describe the bug
I am using protobuf generated structures, and it does not have time.Time type. However it have string type, which is sufficient for my goals. But library does not allow to scan timestamp as string. How can i do so? I cannot modify Response struct, as its a generated code. Also i dont want to copy from intermediate struct.
To Reproduce
try to scan timestamp column to *string field
Expected behavior
CreatedAt containing timestamp in RFC3339Nano string format
Actual behavior
non-nil err, containing message: "cannot scan timestamp (OID 1114) in binary format into *string"
The text was updated successfully, but these errors were encountered: