Re: string not equal query, postgresql 9.4.4

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: John Scalia <jayknowsunix(at)gmail(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: string not equal query, postgresql 9.4.4
Date: 2015-09-17 23:49:25
Message-ID: CAKFQuwawTZkzW75hfU_shS-_uEW7AGw83b_G0ZuWNc6+TFLcXw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Sep 17, 2015 at 6:18 PM, John Scalia <jayknowsunix(at)gmail(dot)com> wrote:

>
> SELECT * FROM results where result <> 'PASS';
>
> and it produced all the rows, not just the ones beginning with visc60 that
> I expected. Based on what you had written, I should have seen the correct
> output. So, any ideas?
>

​EXPLAIN ANALYZE SELECT * FROM results WHERE result <> 'PASS';

What happens when you run the following? Do you see the same incorrect
behavior?

WITH vals (v) AS (
VALUES ('PASS'::char(4)), ('FAIL'::char(4))
)
SELECT
​DISTINCT ​
*
FROM vals
WHERE v <> 'PASS'::char(4);

David J.​

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message John Scalia 2015-09-18 00:52:57 Re: string not equal query, postgresql 9.4.4
Previous Message John Scalia 2015-09-17 22:18:42 Re: string not equal query, postgresql 9.4.4