Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSI8Z-00060h-TO for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 04:07:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XSI8Y-00073t-Pn for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 04:07:06 +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 1XSBuW-00081H-Fx for pgsql-bugs@postgresql.org; Thu, 11 Sep 2014 21:28:12 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSBuO-0004pu-4I for pgsql-bugs@postgresql.org; Thu, 11 Sep 2014 21:28:10 +0000 MIME-Version: 1.0 Subject: BUG #11401: When I comparison geting of field returns false, but when I do directly with result returns true To: pgsql-bugs@postgresql.org From: natan@logicasistemas.com.br Date: Thu, 11 Sep 2014 21:27:06 +0000 Message-ID: <20140911212706.2484.18059@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.1 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 11401 Logged by: Natan Medeiros Email address: natan@logicasistemas.com.br PostgreSQL version: 9.1.14 Operating system: Debian Description: Hi everyone, I'm trying to do a query and stops in source below: btrim = clean spaces upper = a -> A pcc.mac returns "" (null) pcc.username returns "SIMONE.GISELIA" btrim(upper(pcc.mac::character varying::text)) <> btrim(upper(pcc.username::text)) if I put the code above, the postgres understand as false, but if I put the code below returns true, why? SELECT CASE WHEN "" <> "SIMONE.GISELIA" THEN true ELSE false end Both fields returns different text and the result is false and shouldn't. I'm stuck on that and don't know what do. I need to compare this options, if don't, the source not work. If anyone could help me I will be glad for that. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs