lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.01k stars 910 forks source link

encode: fix 2400 time encoding for time/timetz #944

Closed otan closed 4 years ago

otan commented 4 years ago

Note that Postgres supports 24:00 for both time and timetz operations.

When evaluating "24:00" for both Time and TimeTZ datatypes, the time.Time library does not recognise 24 as a legitimate hour. This requires special parsing for it to work. As such, work around the problem by subtracting a day, and adding it back later when we recognize it as 24:00 time.

otan commented 4 years ago

looks like it passes on CI, but the "PASS" is interpreted incorrectly.