Re: [HACKERS] Cast jsonb to numeric, int, float, bool

Поиск
Список
Период
Сортировка
Искать
От
Jim Nasby
Тема
Re: [HACKERS] Cast jsonb to numeric, int, float, bool
Дата
Msg-id
6e36f08b-0fa5-445e-55bc-654b9afb7f04@BlueTreble.com
Ответ на
Список
Дерево обсуждения
[HACKERS] Cast jsonb to numeric, int, float, bool Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: [HACKERS] Cast jsonb to numeric, int, float, bool Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] Cast jsonb to numeric, int, float, bool Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [HACKERS] Cast jsonb to numeric, int, float, bool Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] Cast jsonb to numeric, int, float, bool Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool Darafei Praliaskouski <me@komzpa.net>
Re: Cast jsonb to numeric, int, float, bool Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Re: Cast jsonb to numeric, int, float, bool Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool Tom Lane <tgl@sss.pgh.pa.us>
Re: Cast jsonb to numeric, int, float, bool Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Re: Cast jsonb to numeric, int, float, bool Tom Lane <tgl@sss.pgh.pa.us>
Re: Cast jsonb to numeric, int, float, bool Michael Paquier <michael@paquier.xyz>
Re: Cast jsonb to numeric, int, float, bool Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Re: Re: Cast jsonb to numeric, int, float, bool David Steele <david@pgmasters.net>
Re: Re: Cast jsonb to numeric, int, float, bool Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@sigaev.ru>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@sigaev.ru>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@sigaev.ru>
Re: Cast jsonb to numeric, int, float, bool Robert Haas <robertmhaas@gmail.com>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@sigaev.ru>
Re: Cast jsonb to numeric, int, float, bool Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Cast jsonb to numeric, int, float, bool ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Re: Cast jsonb to numeric, int, float, bool Robert Haas <robertmhaas@gmail.com>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@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>
Re: Cast jsonb to numeric, int, float, bool Teodor Sigaev <teodor@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 Aleksander Alekseev <a.alekseev@postgrespro.ru>
On 2/1/17 8:26 AM, Nikita Glukhov wrote:
>> If you find it useful, I can also add support of json and other types,
>> such as smallint and bigint.
>
> Yes, I'd like to have support for other types and maybe for json.

There's been previous discussion about something similar, which would be 
better supporting "casting an unknown to smallint". IIRC there's some 
non-trivial problem with trying to support that.

> Some comments about the code: I think it would be better to
>  * add function for extraction of scalars from pseudo-arrays
>  * iterate until WJB_DONE to pfree iterator

I'm not sure what your intent here is, but if the idea is that a json 
array would magically cast to a bool or a number data type I think 
that's a bad idea.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


В списке pgsql-hackers по дате отправления
От: Jim Nasby
Дата:
От: Tom Lane
Дата:
FAQ