postgresql in activerecord 4.2 behave differently