Re: [GENERAL] jsonb - Mailing list pgsql-general

From Johannes Graën
Subject Re: [GENERAL] jsonb
Date
Msg-id 98fad95e-e731-cf0d-f4d3-3968a945c8a4@selfnet.de
Whole thread Raw
In response to [GENERAL] jsonb  (hmidi slim <hmidi.slim2@gmail.com>)
List pgsql-general
On 11/14/2017 11:30 PM, hmidi slim wrote:
> I'm trying to use the function to_jsonb and create the name:
> to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}');

This query converts a string into a JSON object that consist of that
string. I guess what you intend to accomplish is rather:

select jsonb_build_object('key1', 'text1', 'key2', 'text2');




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] jsonb
Next
From: John R Pierce
Date:
Subject: Re: [GENERAL] jsonb