BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON

From: bouda(at)edookit(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON
Date: 2014-11-26 08:10:59
Message-ID: 20141126081059.15510.5034@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 12070
Logged by: Ondřej Bouda
Email address: bouda(at)edookit(dot)com
PostgreSQL version: 9.4beta2
Operating system: Windows 7 64bit
Description:

The hstore_to_json_loose(hstore) produces an invalid JSON in the following
case:

SELECT hstore_to_json_loose(hstore(ARRAY ['name'], ARRAY ['1.'] :: TEXT
[]))

Output: {"name": 1.}

Expected:
either {"name": "1."}
or {"name": 1}
(the latter being the preferred one so that it produces the same JSON as
hstore_to_jsonb_loose(hstore))

The actual output is indeed incorrect as JSON does not permit `1.` - it must
be a string.

Tested with PostgreSQL 9.4 RC1 and still wrong.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message maxim.boguk 2014-11-26 13:08:10 BUG #12071: Stat collector went crasy (50MB/s constant writes)
Previous Message Michael Paquier 2014-11-26 05:54:50 Re: BUG #12024: autocomplete doesn't work for ALTER CONSTRAINT

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-11-26 08:25:18 Re: [REVIEW] Re: Compression of full-page-writes
Previous Message Jakob Egger 2014-11-26 08:01:42 Re: [pgsql-packagers] Palle Girgensohn's ICU patch