Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSN0G-0006ea-G9 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Dec 2017 13:04:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSN0F-0001us-0Q for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Dec 2017 13:04:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eSN0E-0001ui-QX for pgsql-bugs@lists.postgresql.org; Fri, 22 Dec 2017 13:04:42 +0000 Received: from forward3o.cmail.yandex.net ([2a02:6b8:0:1a72::288]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eSN0B-0004h4-KT for pgsql-bugs@postgresql.org; Fri, 22 Dec 2017 13:04:42 +0000 Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward3o.cmail.yandex.net (Yandex) with ESMTP id 68D6C20C49; Fri, 22 Dec 2017 16:04:35 +0300 (MSK) Received: from web13g.yandex.ru (web13g.yandex.ru [2a02:6b8:0:1402::23]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vwYhzO1z3U-4YSSljK8; Fri, 22 Dec 2017 16:04:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zsrv.org; s=mail; t=1513947874; bh=noTkacvJ5/Q7pO8QM3GWMI9qRauP9AN1u4spyco6CGM=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=JE0SpxqHC69rgMZGKBxHeNqifC/s6hJ3pyStHbPzPTGfAw7xASSg7pugBHdyqPnPM yu1Xp0LcYenUgqXqPpW1nQZZSgN3AL3Pgdar9YQN17nseCIc1w0NHDbeX8z23Mbe7b 8o5oE7N7nvVsKR7/iLWPiIysERzdp69qmhNZEqaA= Authentication-Results: mxback15g.mail.yandex.net; dkim=pass header.i=@zsrv.org Received: by web13g.yandex.ru with HTTP; Fri, 22 Dec 2017 16:04:34 +0300 From: Sergei Kornilov To: yunlong.gao , "pgsql-bugs@postgresql.org" In-Reply-To: References: Subject: Re: May be a jsonb type bug MIME-Version: 1.0 Message-Id: <129801513947874@web13g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 22 Dec 2017 16:04:34 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi 'null' - is valid JSON document, but not array or object. It is just JSON-null in JSON. (not NULL in terms RDBMS) Same as '"test"' - is valid JSON-encoded string 'test', '10' - valid JSON int scalar. jsonb_array_length accept only JSON array documents: '[1,2,3]', '[null, null]', '[]', '[{"n":1}]' and so on and not accept scalars and objects Regards, Sergej