Re: Cast jsonb to numeric, int, float, bool

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: Cast jsonb to numeric, int, float, bool
Дата
Msg-id dda6f9a9-4290-a85b-7d4d-e4b9968bac7e@sigaev.ru
обсуждение исходный текст
Ответ на Re: Cast jsonb to numeric, int, float, bool  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Cast jsonb to numeric, int, float, bool  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
>> 1) Does this really pass muster from the translatability standpoint?
>> I doubt it.
Huh, I missed that.

> I think you want the callers to look like
> 
>       if (!JsonbExtractScalar(&in->root, &v) || v.type != jbvNumeric)
>         cannotCastJsonbValue(v.type, "double precision");
> 
> where the subroutine contains the whole ereport() call, and its lookup
> table entries are e.g.
> 
>     gettext_noop("cannot cast jsonb string to type %s")
Thanks for your idea, patch is attached
-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Вложения

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

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: [HACKERS] Clock with Adaptive Replacement
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: SQL:2011 Valid-Time Support