Re: jsonb

From: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: jsonb
Date: 2017-11-14 22:30:23
Message-ID: CAMsqVxvpBPy5shgEaLqLY45mjEAdUBfijxQTFJuw0qHFdNc3wA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com>:

> On Tue, Nov 14, 2017 at 3:32 PM, hmidi slim <hmidi(dot)slim2(at)gmail(dot)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
>

In response to

  • Re: jsonb at 2017-11-14 22:09:36 from Merlin Moncure

Responses

  • Re: jsonb at 2017-11-14 23:06:52 from Merlin Moncure
  • Re: jsonb at 2017-11-14 23:38:06 from John R Pierce

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2017-11-14 22:56:38 Re: PGPool in Master-Master mode, is it possible?
Previous Message Merlin Moncure 2017-11-14 22:09:36 Re: jsonb