From 81dbdeea7ad94d8263ce4044307723aaffece553 Mon Sep 17 00:00:00 2001 From: David Yamnitsky Date: Sat, 22 Sep 2018 15:15:15 -0400 Subject: [PATCH] add float types to database/sql ColumnType ScanType() --- messages.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/messages.go b/messages.go index e98197d0..aca6ae2e 100644 --- a/messages.go +++ b/messages.go @@ -53,6 +53,10 @@ func (fd FieldDescription) PrecisionScale() (precision, scale int64, ok bool) { func (fd FieldDescription) Type() reflect.Type { switch fd.DataType { + case pgtype.Float8OID: + return reflect.TypeOf(float64(0)) + case pgtype.Float4OID: + return reflect.TypeOf(float32(0)) case pgtype.Int8OID: return reflect.TypeOf(int64(0)) case pgtype.Int4OID: