Re: jsonb

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: jsonb
Date: 2017-11-14 23:06:52
Message-ID: CAHyXU0wYrTfnUS7YsiDThQBscMCd5-fjBdyVKiCQEinctz5A8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Still not quite following. My advice would be to:

#1) work out the SQL you want the database to be running and verify
the results are correct

#2) figure out out to get the ORM to send that SQL

If you need help figuring out that SQL the ORM is actually running,
try turning on statement logging in postgresql.conf and watching the
log.

merlin

In response to

  • Re: jsonb at 2017-11-14 22:30:23 from hmidi slim

Browse pgsql-general by date

  From Date Subject
Next Message Johannes Graën 2017-11-14 23:37:39 Re: jsonb
Previous Message Tatsuo Ishii 2017-11-14 22:56:38 Re: PGPool in Master-Master mode, is it possible?