Re: How to call JSONB_INSERT with integer as the new to-be-inserted value?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to call JSONB_INSERT with integer as the new to-be-inserted value?
Дата
Msg-id 663494.1599945984@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to call JSONB_INSERT with integer as the new to-be-inserted value?  (Alexander Farber <alexander.farber@gmail.com>)
Ответы Re: How to call JSONB_INSERT with integer as the new to-be-inserted value?  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
Alexander Farber <alexander.farber@gmail.com> writes:
> ERROR:  function jsonb_insert(jsonb, unknown, integer) does not exist
> LINE 1: SELECT JSONB_INSERT(_user, '{uid}', _uid)
>                ^
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.
> QUERY:  SELECT JSONB_INSERT(_user, '{uid}', _uid)
> CONTEXT:  PL/pgSQL function words_get_user(jsonb) line 44 at assignment

I think it'd work to do

JSONB_INSERT(_user, '{uid}', to_jsonb(_uid));

The third argument has to be jsonb, not something else.

            regards, tom lane



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

Предыдущее
От: Steve Baldwin
Дата:
Сообщение: Re: How to call JSONB_INSERT with integer as the new to-be-inserted value?
Следующее
От: Alexander Farber
Дата:
Сообщение: Re: How to call JSONB_INSERT with integer as the new to-be-inserted value?