BUG #11401: When I comparison geting of field returns false, but when I do directly with result returns true - Mailing list pgsql-bugs

From natan@logicasistemas.com.br
Subject BUG #11401: When I comparison geting of field returns false, but when I do directly with result returns true
Date
Msg-id 20140911212706.2484.18059@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: kkaminski@vidsys.com
Date:
Subject: BUG #11399: CreateUser error when upgrading
Next
From: srinivas.mca41@gmail.com
Date:
Subject: BUG #11404: Current PostgreSQL Databases Configuration