Re: Calling json_* functions with JSONB data

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Calling json_* functions with JSONB data
Дата
Msg-id 22179.1464035848@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Calling json_* functions with JSONB data  (Peter van Hardenberg <pvh@pvh.ca>)
Ответы Re: Calling json_* functions with JSONB data  (Peter van Hardenberg <pvh@pvh.ca>)
Re: Calling json_* functions with JSONB data  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Peter van Hardenberg <pvh@pvh.ca> writes:
> Great question, Marko. If you can point me towards an example I'll take a
> look, but I'll proceed with the current understanding and suggestions and
> see what people have to say.

I believe Marko's just complaining about the case for unknown-type
arguments, for example:

regression=# select json_array_length('[1,2,3]');json_array_length 
-------------------                3
(1 row)

The parser has no trouble resolving this because there is only one
json_array_length(); but if there were two, it would fail to make a
determination of which one you meant.

AFAICS the only way to fix that would be to introduce some preference
between the two types.  For example, we could move both 'json' and 'jsonb'
into their own typcategory ('J' is unused...) and then mark 'jsonb' as
the preferred type in that category.  This would require a fair amount of
experimentation to determine if it upsets any cases that work conveniently
today; but right offhand I don't see any fatal problems with such an idea.
        regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Changed SRF in targetlist handling
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Changed SRF in targetlist handling