Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEkoh-00071Q-FH for pgsql-general@arkaria.postgresql.org; Tue, 14 Nov 2017 23:40:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eEkog-0000xJ-Vi for pgsql-general@arkaria.postgresql.org; Tue, 14 Nov 2017 23:40:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eEkm9-0001bw-3j for pgsql-general@postgresql.org; Tue, 14 Nov 2017 23:37:53 +0000 Received: from mail-1.server.selfnet.de ([2001:7c0:e701:126::65] helo=mail.wh-stuttgart.net) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eEkm5-0008M8-CX for pgsql-general@postgresql.org; Tue, 14 Nov 2017 23:37:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.wh-stuttgart.net (Postfix) with ESMTP id 49CEF184F72; Wed, 15 Nov 2017 00:37:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.selfnet.de Received: from mail.wh-stuttgart.net ([127.0.0.1]) by localhost (mail-1.server.selfnet.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IJOaSJtcFnsH; Wed, 15 Nov 2017 00:37:45 +0100 (CET) Received: from [IPv6:2a02:200:2e00:a230:26f7:15c6:bd4a:cc7] (unknown [IPv6:2a02:200:2e00:a230:26f7:15c6:bd4a:cc7]) by mail.wh-stuttgart.net (Postfix) with ESMTPSA; Wed, 15 Nov 2017 00:37:45 +0100 (CET) Subject: Re: jsonb References: <46c9439f-ae20-c72f-31ff-b21a942eaac1@gmail.com> To: hmidi slim Cc: pgsql-general@postgresql.org From: =?UTF-8?Q?Johannes_Gra=c3=abn?= X-Forwarded-Message-Id: <46c9439f-ae20-c72f-31ff-b21a942eaac1@gmail.com> Message-ID: <98fad95e-e731-cf0d-f4d3-3968a945c8a4@selfnet.de> Date: Wed, 15 Nov 2017 00:37:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <46c9439f-ae20-c72f-31ff-b21a942eaac1@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE-1901 Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org 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