Problem with select and null

Поиск
Список
Период
Сортировка
От Frank Millman
Тема Problem with select and null
Дата
Msg-id 000801c48e7a$362bc910$0401a8c0@chagford.com
обсуждение исходный текст
Ответы Re: Problem with select and null  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all
 
'SELECT (null * null)' returns null
 
'SELECT (null - 0)' returns null
 
'SELECT ((null * null) - 0)' gives the following error -
ERROR: operator does not exist: "char" - integer
 
Why does this statement give an error? I would expect it to return null.
 
Under some circumstances my program generates the above select statement, so this is not an academic question.
 
Platform is PostgreSQL 7.4.1, running on Redhat 9.
 
Is this a bug? Is there any workaround? My workaround for now is to 'coalesce' to zero all the values which could return null. The result is zero instead of null, which is not what I want, but I can live with it in the short term.
 
TIA for any suggestions.
 
Frank Millman

В списке pgsql-general по дате отправления:

Предыдущее
От: Rick G
Дата:
Сообщение: Re: monitor+keyboard+mouse together
Следующее
От: Guy Naor
Дата:
Сообщение: Representating a family tree