Support decoding of TimestampOid in stdlib driver

pull/86/head
Samuel Stauffer 2015-08-25 17:24:33 -07:00
parent a0c76b897c
commit a56e35ad0a
2 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,7 @@ func init() {
databaseSqlOids[pgx.Float8Oid] = true
databaseSqlOids[pgx.DateOid] = true
databaseSqlOids[pgx.TimestampTzOid] = true
databaseSqlOids[pgx.TimestampOid] = true
}
type Driver struct {

View File

@ -1089,6 +1089,7 @@ func decodeTimestamp(vr *ValueReader) time.Time {
if vr.Len() != 8 {
vr.Fatal(ProtocolError(fmt.Sprintf("Received an invalid size for an timestamp: %d", vr.Len())))
return zeroTime
}
microsecSinceY2K := vr.ReadInt64()