From: | Baldur Norddahl <bbn-pgsql(dot)general(at)clansoft(dot)dk> |
---|---|
To: | Guy Fraser <guy(at)incentre(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: why the need for is null? |
Date: | 2004-01-03 22:05:15 |
Message-ID: | 1073167515.3ff73c9bb9887@localhost |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Quoting Guy Fraser <guy(at)incentre(dot)net>:
> There already is an operator, and it is the ANSI SQL operator "IS". Just
> because "IS" does not use puctuation characters does not mean it is not
> an operator.
"IS" is not an operator in postgresql, at least not in the same sense that "="
is an operator. You can not do "\do is" while "\do =" works fine.
> select coalesce(string_column,'') from some_table ;
Will postgresql still make effective use of the indexes if I use a function like
coalesce on the column before comparing it?
Even if it does, the method I already use is more effective.
> If you still don't understand, then use MySQL it is messed up and allows
> weird things like most of what you want to do.
1) I understand the issues involved perfectly. I just happens to have a table
where it would be usefull that NULL=NULL is true. It is not so, and therefore I
have to use a syntax that is hard to read and I have been made to understand
that I will have to accept that. Fine.
2) What kind of crap is that flaming me like this? Do all users that ask a
question about why postgresql or the sql standard implements a feature in a
specific way, end up being told to switch to mysql?
3) Mysql knows how to compare nulls:
mysql> select null=null;
+-----------+
| null=null |
+-----------+
| NULL |
+-----------+
1 row in set (0.01 sec)
mysql> select null is null;
+--------------+
| null is null |
+--------------+
| 1 |
+--------------+
1 row in set (0.00 sec)
Baldur
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2004-01-03 23:01:33 | Re: website doc search is extremely SLOW |
Previous Message | A E | 2004-01-03 18:11:55 | Passing a comma delimited list to a function |