-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Stings vs. bites weirdness #4312
Comments
Also, even though I can get the insert to work if I leave out the |
I think the correct behaviour is that you wouldn't need the cast on the I dug into this issue a bit, and it's tricky! Basically, we do the type inference correctly during query preparation, but we don't distinguish between I tried to fix this using Perhaps this is something our new type system can better contend with (strings need to coerce to byte arrays?). cc @knz @nvanbenschoten @mjibson |
Ok so if we look at #4121 there are 3 things that could/should happen:
|
I don't like the idea of |
I think @knz's suggestion would work.
|
What knz said. On Thu, Feb 11, 2016 at 8:55 AM, Tamir Duberstein notifications@github.com
|
Minor typo in issue title: "Stings" s.b. "Strings". (Or maybe "bytes" s.b. "bites" as in "Stings vs. bites"?!) |
Thanks @JackKrupansky I fixed it. Lol. |
@tamird The |
Duh. PR incoming. |
I have the following schema:
When trying to insert into the table with the following go code, it fails:
The failure is:
pq: invalid cast: parameter -> BYTEA
It works if I don't add the cast. However, when doing a select:
SELECT commentID, userID, message, timestamp FROM loadgen.comments WHERE photoID = $1::bytea ORDER BY timestamp LIMIT 100
If I DON'T add the
::bytea
cast, it fails with:pq: unsupported comparison operator: <bytes> = <string>
The text was updated successfully, but these errors were encountered: