Re: [GENERAL] jsonb

Поиск
Список
Период
Сортировка
От hmidi slim
Тема Re: [GENERAL] jsonb
Дата
Msg-id CAMsqVxvpBPy5shgEaLqLY45mjEAdUBfijxQTFJuw0qHFdNc3wA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] jsonb  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: [GENERAL] jsonb  (Merlin Moncure <mmoncure@gmail.com>)
Re: [GENERAL] jsonb  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
I'm trying to use the function to_jsonb and create the name:
to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}');
But after that I used Objection.js ORM to get data using the query:
Product.query().where('id',1).then(prod => {console.log(prod)})
I think that the problem maybe with the usage of to_jsonb function, maybe I miss something. But when I fetch the data with the ORM I found that the type was a string and not a jsonb


2017-11-14 23:09 GMT+01:00 Merlin Moncure <mmoncure@gmail.com>:
On Tue, Nov 14, 2017 at 3:32 PM, hmidi slim <hmidi.slim2@gmail.com> wrote:
> I have a column name of type 'jsonb' on my table named product. The format
> of the column:
> name: {"key1": "text1", "key2": "text2"}
>
> When I make a query to fetch data from the table I got this format:
> name: '{"key1": "text1", "key2": "text2"}'
>
> Why does postgresql returns the name such as string type and not jsonb? is
> it a bug or is there something else to add?

not quite following.  Can you paste the query you are trying to
execute along with the results vs. expectation?  thanks

merlin

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: [GENERAL] jsonb
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [GENERAL] PGPool in Master-Master mode, is it possible?