-
Notifications
You must be signed in to change notification settings - Fork 162
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
MySQL type YEAR is not supported #287
Comments
Hi @ppolydoras, Thanks for reporting this issue. I can reproduce this issue at my end. As error message suggests, Postgres does not have YEAR data type (or equivalent). As per MySQL documentation, Year is a 1-byte type used to represent year values. I think, we can map MySQL year to Postgres's smallint data type but there might be some behavior differences if we do so. for e.g:
We could not be able to achieve the above behaviour if we map year to smallint in Postgres. I don't think we have a better workaround for the same apart from above. Do you have any suggestions on this? |
Generally speaking, SMALLINT is the best solution. Perhaps in certain use-cases DATE would be more preferable, since they are both time-related datatypes, but it's certainly not the most generic choice. |
Thanks. We will take this further and try to fix mapping MySQL's year type to Postgres smallint. |
Hi @ppolydoras, After careful analysis, we decided we are not going to fix this (MySQL's year map to smallint). YEAR as a data type has certain constraints and limitations and we can't achieve those completely in Postgres. You can manually import those tables which have YEAR data type and map those to smallint/numeric as per your need. |
I'm importing a MySQL schema with a table that includes a YEAR datatype column.
This fails to be imported with the error message:
type "year" does not exist
The text was updated successfully, but these errors were encountered: