Skip to content

Conversation

@cbandy
Copy link
Contributor

@cbandy cbandy commented Aug 11, 2016

Fixes the error in (and motivation for) #391:

pq: invalid input syntax for type time: "0001-01-01T17:00:00Z BC"

I couldn't find a spec that called for space rather than T, but every version of Postgres I tested behaves this way.

I've included a test for the negative case in case Postgres changes and we want to revert this.

@freeformz
Copy link

How did this ever work then?

@cbandy
Copy link
Contributor Author

cbandy commented Aug 12, 2016

From what I can tell, we've been using the RFC3339Nano format since c618755. I guess we've just never tested sending a time.Time into a time nor timetz type.

@freeformz
Copy link

👍

@cbandy
Copy link
Contributor Author

cbandy commented Aug 13, 2016

Changed it to specify the format rather than Replace on the result.

@freeformz
Copy link

even better

@madelynnblue
Copy link
Collaborator

@cbandy mind rebasing this to master so we can retest since it's been so long? That should also fix the go 1.4 errors.

PostgreSQL accepts this format as input to more temporal types.
@cbandy
Copy link
Contributor Author

cbandy commented Jan 1, 2017

Rebased.

@madelynnblue madelynnblue merged commit 8df6253 into lib:master Jan 3, 2017
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

Successfully merging this pull request may close these issues.

3 participants