Unix Technical Forum

BUG #2417: bug for finding string in column

This is a discussion on BUG #2417: bug for finding string in column within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2417 Logged by: James Email address: james@mercstudio.com PostgreSQL version: 8.1 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:58 AM
James
 
Posts: n/a
Default BUG #2417: bug for finding string in column


The following bug has been logged online:

Bug reference: 2417
Logged by: James
Email address: james@mercstudio.com
PostgreSQL version: 8.1
Operating system: Microsoft Windows XP Professional
Description: bug for finding string in column
Details:

hi,

i've encounter bug where when a field is empty / null (type varchar(255) ),
when i use the sql query <> 'myvalue', it seems to be false all the time.


example:
select * from user_profile where acc_lock <> 'Y'

where the acc_lock field for all rows were empty...

2nd, hopefully that postgresql can be flexible to accept empty '' as null
search as well...

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:58 AM
Stephan Szabo
 
Posts: n/a
Default Re: BUG #2417: bug for finding string in column

On Tue, 2 May 2006, James wrote:

>
> The following bug has been logged online:
>
> Bug reference: 2417
> Logged by: James
> Email address: james@mercstudio.com
> PostgreSQL version: 8.1
> Operating system: Microsoft Windows XP Professional
> Description: bug for finding string in column
> Details:
>
> hi,
>
> i've encounter bug where when a field is empty / null (type varchar(255) ),
> when i use the sql query <> 'myvalue', it seems to be false all the time.


If it's null, it's actually returning unknown (not true or false) and
as far as we know that's not a bug because that's how SQL defines the
comparison operators.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:58 AM
Bruno Wolff III
 
Posts: n/a
Default Re: BUG #2417: bug for finding string in column

On Tue, May 02, 2006 at 10:34:12 +0000,
James <james@mercstudio.com> wrote:
>
> i've encounter bug where when a field is empty / null (type varchar(255) ),
> when i use the sql query <> 'myvalue', it seems to be false all the time.


Empty and NULL are not the same thing. NULL <> to any value evaluates
to NULL which will not satisfy a WHERE clause. This is according to the
SQL (i.e. it's not a bug).

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com