mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Support decoding of TimestampOid in stdlib driver
This commit is contained in:
parent
a0c76b897c
commit
a56e35ad0a
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user