-
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
Implicit typecast literals to correct type (postgres compatibility) #38965
Comments
@stevecookform3, we do coerce many literals already. Text arrays are coming soon: #38869. String <->numeric is tricky to get right, so we haven't done it yet. Json actually does get automatically coerced:
|
But point taken that this is irritating. What ORM or framework do you use? Would you be willing to give us a sample of your application that runs into these issues? Thanks! |
(github seems to have lost my previous comment, so apologies if this is a duplicate) |
This works in CockroachDB version 19.2 and later.
I believe these examples will require type resolution of functions as described in the Postgres type conversion docs. This is related to implicit casts (see #75101). |
These examples work now. |
@jordanlewis
|
Isn't that a new kind of problem though? Should we open a new issue for that one? |
Looks like postgres will auto-type cast literals based on the context (more info here: https://www.postgresql.org/docs/10/typeconv.html). That isnt done by CockroachDB.
Thats causing some incompatibilities when we try to migrate postgres over to cockroach.
Here are some simple examples - the following work fine in postgres 9.5, but fail with cockroach 19.1.3 as cockroach doesnt cast them to the expected type.
Looks like some specific examples have been mentioned already here:
#33341 and #23299
However the underlying issue I think is more generic than mentioned on other issues.
Epic CRDB-2474
Jira issue: CRDB-5598
The text was updated successfully, but these errors were encountered: