[GENERAL] = Null is Null?

2009-07-08 Thread Durumdara
Hi! select * from any where is_deleted = Null select * from any where is_deleted in (Null) They are show 0 record. select * from any where is_deleted is Null It is show all records. Some of other DBs are uses Null as Null in = comparisons. Is PG not? What are the rules? Thanks: dd

Re: [GENERAL] = Null is Null?

2009-07-08 Thread Alban Hertroys
On Jul 8, 2009, at 1:30 PM, Durumdara wrote: Hi! select * from any where is_deleted = Null select * from any where is_deleted in (Null) They are show 0 record. Correct, that's normal in SQL. NULL means 'unknown', so you can't say whether is_deleted is true or false when it's NULL. The

Re: [GENERAL] = Null is Null?

2009-07-08 Thread Dimitri Fontaine
Durumdara durumd...@gmail.com writes: Some of other DBs are uses Null as Null in = comparisons. Is PG not? What are the rules? PostgreSQL implements SQL, which has a 3-valued logic. There's True, there's False, and there's NULL. NULL means that we know nothing about what's in there. Would you

Re: [GENERAL] = Null is Null?

2009-07-08 Thread Scott Marlowe
On Wed, Jul 8, 2009 at 6:03 AM, Alban Hertroysdal...@solfertje.student.utwente.nl wrote: This is exactly the reason the 'is null' operator exists. It's exclusively for checking for null values. You can't say 'is_deleted is true' for example. Uh, yes you can. is false also works. and is not

Re: [GENERAL] = Null is Null?

2009-07-08 Thread Scott Bailey
Some DB's say that an empty string is the same as null, it doesn't mean they're right. In fact, it can be rather inconvenient if an empty string in your data also has a meaning (namely 'known to be an empty string' instead of 'unknown')! This is the behavior in Oracle. And I found that out

[GENERAL] NULL NOT NULL

1998-12-08 Thread Bill Sneed
I'm (1) new to postgres (2) trying to "convert" the sample db found in "The Practical SQL Handbook" Bowman, et al. to postgres. When trying to create the following table I get "parser: parse error at or near 'null'" create table authors ( au_id char(11)not null,