Re: Fwd: int type problem in 7.3

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: Fwd: int type problem in 7.3
Дата
Msg-id Pine.LNX.4.21.0210021517040.26902-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на Re: Fwd: int type problem in 7.3  ("Mario Weilguni" <mario.weilguni@icomedias.com>)
Список pgsql-hackers
On Wed, 2 Oct 2002, Mario Weilguni wrote:

> >> But oracle accepts this one:
> >> SQL> select * from re_eintraege where id='';
> >> no rows selected
> >> because oracle treats the empty string as NULL
> >
> >Oracle does that for string data, but it doesn't do it for numerics
> >does it?  In any case, that behavior is surely non-compliant with
> >the SQL spec.
> 
> No, oracle accepts this and works correctly with number() datatype. 
> However I did not know that in postgres '' was treated as '0'.

So what would I be selecting in Oracle if I did:

SELECT * FROM mytable WHERE myfield = ''

where myfield is of VARCHAR type?

If you want to select on NULL, whether or not you think the database is more
intelligent than you in determining what you really want, then write your query
to select on NULL. The chances are your database is not actually a mind reader.


-- 
Nigel J. Andrews



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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Oracle beats up on Open Source Database(s) ... and gets beat back ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump and large files - is this a problem?