Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJN9W-0006aw-26 for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2014 13:39:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJN9V-0007uM-DQ for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Aug 2014 13:39:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJN9U-0007uF-Er for pgsql-bugs@postgresql.org; Mon, 18 Aug 2014 13:39:12 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XJN9O-0000v1-LY for pgsql-bugs@postgresql.org; Mon, 18 Aug 2014 13:39:11 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XJN9L-0005UY-CP for pgsql-bugs@postgresql.org; Mon, 18 Aug 2014 06:39:03 -0700 Date: Mon, 18 Aug 2014 06:39:03 -0700 (PDT) From: Christian Pronovost To: pgsql-bugs@postgresql.org Message-ID: <1408369143374-5815229.post@n5.nabble.com> In-Reply-To: <1408147143170-5815058.post@n5.nabble.com> References: <20140815211138.2543.16364@wrigleys.postgresql.org> <1408147143170-5815058.post@n5.nabble.com> Subject: Re: BUG #11178: JSONB : The NOT operator applies to the <@ operator, even after casting to ::bool MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David G Johnston wrote > The presence of "NOT" does not (aside from a possible bug) change the "<@" > operator into the "@>" operator. I was wrong assuming the inversion of the "<@" operator. > "NOT" simply inverts the supplied boolean value. This does not seem to be the case. In the following example, the same query returns false whether there is a NOT operator or not. SELECT (testcolumn->'ID' <@ '["2"]') FROM "TestJsonb" --Returns false (as expected) SELECT NOT(testcolumn->'ID' <@ '["2"]') FROM "TestJsonb" --Returns false (*not as expected*) To be noted that outside of the context of a table, this works fine: SELECT ('"1"'::jsonb <@ '["2"]') --Returns false (as expected) SELECT NOT('"1"'::jsonb <@ '["2"]') --Returns true (as expected) I am confused -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11178-JSONB-The-NOT-operator-applies-to-the-operator-even-after-casting-to-bool-tp5815056p5815229.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs