Why is hstore_to_json_loose not like hstore_to_jsonb_loose?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Why is hstore_to_json_loose not like hstore_to_jsonb_loose?
Дата
Msg-id 23389.1454455287@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [POC] FETCH limited by bytes.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Integer overflow in timestamp_part()