Skip to content
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

date value '0000-00-00' is not accepted in postgresql #15

Open
zormit opened this issue Jul 16, 2015 · 4 comments
Open

date value '0000-00-00' is not accepted in postgresql #15

zormit opened this issue Jul 16, 2015 · 4 comments

Comments

@zormit
Copy link

zormit commented Jul 16, 2015

Problem: Having a MySQL date field with an undefined date 0000-00-00, it will be the same value in the output. Resulting in:

ERROR:  date/time field value out of range: "0000-00-00"

Solution: It should be NULL instead, because that seems to be the Postgres standard for an undefined date.

@boooch
Copy link

boooch commented Aug 3, 2015

+1

@mihailShumilov
Copy link
Owner

My suggestion use 1971-01-01 for this case
What You think about this?

@zormit
Copy link
Author

zormit commented Oct 15, 2015

I think if NULL is allowed, it's better to replace by NULL, as every other date could interfere with the regularly stored dates and it seems to be the only value in postgres representing "undefined". Maybe an option should be used to let the user decide, what to do when the date is a NOT NULL column. This option could then default to 1971-01-01.

@mihailShumilov
Copy link
Owner

Got idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants