diff --git a/pgtype/convert.go b/pgtype/convert.go index 31ce11e5..8a2afbe1 100644 --- a/pgtype/convert.go +++ b/pgtype/convert.go @@ -337,6 +337,10 @@ func float64AssignTo(srcVal float64, srcValid bool, dst any) error { if v := reflect.ValueOf(dst); v.Kind() == reflect.Ptr { el := v.Elem() switch el.Kind() { + // if dst is a type alias of a float32 or 64, set dst val + case reflect.Float32, reflect.Float64: + el.SetFloat(srcVal) + return nil // if dst is a pointer to pointer, strip the pointer and try again case reflect.Ptr: if el.IsNil() {