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

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Cast jsonb to numeric, int, float, bool
Дата
Msg-id 20180330142423.GB1411@e733.localdomain
обсуждение исходный текст
Ответ на 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))
Список pgsql-hackers
Hello Teodor,

> > Agree, something like "could not convert jsonb value to boolean type. jsonb
> > value must be scalar boolean type"?
>
> I checked what error messages are used currently:
>
> ```
> # select 123::int4::jsonb;
> ERROR:  cannot cast type integer to jsonb
> LINE 1: select 123::int4::jsonb;
> ```
>
> I suggest to follow the same template, i.e. "cannot cast type jsonb to
> bool", etc.

On second thought this message is misleading. We can cat jsonb to bool,
the problem is that the document is not a bool value.

--
Best regards,
Aleksander Alekseev

Вложения

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

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Cast jsonb to numeric, int, float, bool
Следующее
От: David Fetter
Дата:
Сообщение: Re: Feature Request - DDL deployment with logical replication