Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2qxm-00077O-5A for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jul 2021 08:06:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2qxl-00081j-1R for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jul 2021 08:06:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2qxk-00081b-RC for pgsql-bugs@lists.postgresql.org; Mon, 12 Jul 2021 08:06:48 +0000 Received: from forward104p.mail.yandex.net ([77.88.28.107]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2qxi-0008Mk-HA for pgsql-bugs@lists.postgresql.org; Mon, 12 Jul 2021 08:06:48 +0000 Received: from sas1-f45a06513e06.qloud-c.yandex.net (sas1-f45a06513e06.qloud-c.yandex.net [IPv6:2a02:6b8:c08:b315:0:640:f45a:651]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 5921F4B009EF; Mon, 12 Jul 2021 11:06:34 +0300 (MSK) Received: from mail.yandex.ru (mail.yandex.ru [217.66.156.101]) by sas1-f45a06513e06.qloud-c.yandex.net (mxback/Yandex) with HTTP id X6LhgZ1IXqM1-6XIqqPvu; Mon, 12 Jul 2021 11:06:33 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zsrv.org; s=mail; t=1626077193; bh=lzy/UIvdqj9IqqqqJxySFdrBZeBQAGTy8b8HtDWPzNo=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=X04oLA3I7V4e584U5ew0xG3QMgdq7V203bZIQsBjzp/8Ef0uMv2G+18wuE18gijoS MbGXA+ABH5OgyTAS07FBPmvG5oza5W8sf027j19wKE8syQXXe9MotBKwcyLi2c36aN Z/m+Wtfoai8ROglpPxBxwTuXt8qisRaUvOutntVo= Authentication-Results: sas1-f45a06513e06.qloud-c.yandex.net; dkim=pass header.i=@zsrv.org Received: by sas1-55829ddbd171.qloud-c.yandex.net with HTTP; Mon, 12 Jul 2021 11:06:33 +0300 From: Sergei Kornilov To: "ineron@icloud.com" , "pgsql-bugs@lists.postgresql.org" In-Reply-To: <17099-7b756eb97b8e9e7a@postgresql.org> References: <17099-7b756eb97b8e9e7a@postgresql.org> Subject: Re: BUG #17099: Problem with EXECUTE and JSON MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 12 Jul 2021 11:06:33 +0300 Message-Id: <324211626076936@mail.yandex.ru> Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello > Why i get an error if sends text but not error if send digits ? Because text '123' is valid JSON. text 'text' - not valid. text '"text"' is valid JSON string. Your example could be reduced to > select cast(json_build_object('name','name')->>'name' as jsonb); That means > select cast('name'::text as jsonb); Probably you wanted ->'name', not ->>'name'. JSON(b) operator -> will return json/jsonb type. regards, Sergei