hstore_to_json_loose() contains a heuristic that says that an hstore value
that looks like a JSON number should be treated as a number (and hence not
quoted). That logic has an oversight in it, as per bug #13906, but it's
straightforward to fix.
However, I noticed that hstore_to_jsonb_loose() has completely different
(and much uglier) code to make the identical decision. Is there a good
reason for that? It seems to have avoided the bug in IsValidJsonNumber,
but looking at it doesn't fill me with confidence that it has no other
bugs, and anyway it's not clear why these two functions should have
different edge-case behaviors about what is a number and what is not.
So I am very sorely tempted to replace hstore_to_jsonb_loose()'s heuristic
with IsValidJsonNumber().
Comments, objections?
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера