CREATE TABLE IF NOT EXISTS public.point_series
(
point_id character varying(36) COLLATE pg_catalog."default" NOT NULL,
timestamp_utc timestamp with time zone NOT NULL,
timestamp_local timestamp without time zone NOT NULL,
double_value double precision,
org_id character varying(50) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
geoshape geometry
)
I have a postgres table
with a double value
I can insert a NaN into the double_value
from the documentation it is allowed https://www.postgresql.org/docs/9.3/datatype-numeric.html
The call originates from github.com/jackc/pgx
When I do query it panics Here is the stack dump
The code that is causing it https://github.com/jackc/pgtype/blob/6dd004c8b8f4f938a26778020882139b8f4de1c2/ext/shopspring-numeric/decimal.go#L262
The num.DecodeBinary looks like its doing the right thing and sets internal values
Then it proceeds to pass a nil to decimal.NewFromBigInt(...). i.e. num.Int is nil.
Should there be a NaN == true check here?