postgresql/contrib/hstore
Tom Lane 41d2c081ce Make hstore_to_jsonb_loose match hstore_to_json_loose on what's a number.
Commit e09996ff8d removed some ad-hoc code in hstore_to_json_loose
that determined whether an hstore value string looked like a number,
in favor of calling the JSON parser's is-it-a-number code.  However,
it neglected the fact that the exact same code appeared in
hstore_to_jsonb_loose.

This is not a bug, exactly, because the requirements on the two functions
are not the same: hstore_to_json_loose must accept only syntactically legal
JSON numbers as numbers, or it will produce invalid JSON output, as per bug
#12070 which spawned the prior commit.  But hstore_to_jsonb_loose could
accept anything that numeric_in will eat, other than Inf and NaN.

Nonetheless it seems surprising and arbitrary that the two functions don't
use the same rules for what is a number versus what is a string; especially
since they did use the same rules before the aforesaid commit.  For one
thing, that means that doing hstore_to_json_loose and then casting to jsonb
can produce results different from doing just hstore_to_jsonb_loose.

Hence, change hstore_to_jsonb_loose's logic to match hstore_to_json_loose,
ie, hstore values are treated as numbers when they match the JSON syntax
for numbers.

No back-patch, since this is more in the nature of a definitional change
than a bug fix.
2016-02-03 12:04:02 -05:00
..
data Add GIN support for pg_trgm. From Guillaume Smet <guillaume.smet@gmail.com> 2007-03-14 14:21:53 +00:00
expected Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage. 2016-02-03 01:39:48 -05:00
sql Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage. 2016-02-03 01:39:48 -05:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Switch to CRC-32C in WAL and other places. 2014-11-04 11:39:48 +02:00
hstore--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
hstore--1.1--1.2.sql Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
hstore--1.2--1.3.sql Introduce jsonb, a structured format for storing json. 2014-03-23 16:40:19 -04:00
hstore--1.3.sql Fix assorted inconsistencies in GIN opclass support function declarations. 2016-01-19 22:32:22 -05:00
hstore--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
hstore.control Introduce jsonb, a structured format for storing json. 2014-03-23 16:40:19 -04:00
hstore.h Dodge a macro-name conflict with Perl. 2015-11-19 14:54:11 -05:00
hstore_compat.c Dodge a macro-name conflict with Perl. 2015-11-19 14:54:11 -05:00
hstore_gin.c Dodge a macro-name conflict with Perl. 2015-11-19 14:54:11 -05:00
hstore_gist.c Dodge a macro-name conflict with Perl. 2015-11-19 14:54:11 -05:00
hstore_io.c Make hstore_to_jsonb_loose match hstore_to_json_loose on what's a number. 2016-02-03 12:04:02 -05:00
hstore_op.c Dodge a macro-name conflict with Perl. 2015-11-19 14:54:11 -05:00