Support decoding of TimestampOid in stdlib driver
This commit is contained in:
@@ -73,6 +73,7 @@ func init() {
|
|||||||
databaseSqlOids[pgx.Float8Oid] = true
|
databaseSqlOids[pgx.Float8Oid] = true
|
||||||
databaseSqlOids[pgx.DateOid] = true
|
databaseSqlOids[pgx.DateOid] = true
|
||||||
databaseSqlOids[pgx.TimestampTzOid] = true
|
databaseSqlOids[pgx.TimestampTzOid] = true
|
||||||
|
databaseSqlOids[pgx.TimestampOid] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
|
|||||||
@@ -1089,6 +1089,7 @@ func decodeTimestamp(vr *ValueReader) time.Time {
|
|||||||
|
|
||||||
if vr.Len() != 8 {
|
if vr.Len() != 8 {
|
||||||
vr.Fatal(ProtocolError(fmt.Sprintf("Received an invalid size for an timestamp: %d", vr.Len())))
|
vr.Fatal(ProtocolError(fmt.Sprintf("Received an invalid size for an timestamp: %d", vr.Len())))
|
||||||
|
return zeroTime
|
||||||
}
|
}
|
||||||
|
|
||||||
microsecSinceY2K := vr.ReadInt64()
|
microsecSinceY2K := vr.ReadInt64()
|
||||||
|
|||||||
Reference in New Issue
Block a user