Re: BUG #13906: improper hstore_to_json_loose functioning - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13906: improper hstore_to_json_loose functioning
Date
Msg-id 22458.1454453728@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13906: improper hstore_to_json_loose functioning  (dmitry-ryabov@mail.ru)
List pgsql-bugs
dmitry-ryabov@mail.ru writes:
> select hstore_to_json_loose(hstore('abc', '2016-01-01'))
> any date/time/timestamp interpreted as the number

Yeah, that's broken all right.  Looking more closely, the combination of
IsValidJsonNumber and json_lex_number will fail to notice trailing junk
that is not part of a number unless that junk is (or at least begins with)
an alphanumeric.  The "-" here breaks that.

Will fix, thanks for the report!

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13908: Query returns too few rows
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #13908: Query returns too few rows