Hi,

I'm in the process of deploying my app on Heroku and have run into a
problem with the way PostgreSQL handles B.C. dates.

My local MySQL database contains a events table that has a start_at
column which is a datetime. I can use negative years without any
issues. For example, my code is something like

e = Event.new(:start_at => DateTime.new(-5000))

Here's a snippet of the log file when I save it locally:

INSERT INTO "events" (... "start_at" ... ) VALUES(... '-5000-01-01
00:00:00'...)

However with PostgreSQL it will fail:

ActiveRecord::StatementInvalid (PGError: ERROR:  time zone
displacement out of range: "-5000-01-01 00:00:00.000000"
: INSERT INTO "events" (... "start_at", ...) VALUES(... E'',
'-5000-01-01 00:00:00.000000' ...) RETURNING "id"):

I assume this problem is caused by the negative year even though it
says it's the time zone because positive years work fine. Any ideas?

Appreciate the help,
Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to