Re: bug or feature, || -operator and NULLs

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: bug or feature, || -operator and NULLs
Дата
Msg-id 200610181507.43034.andreak@officenet.no
обсуждение исходный текст
Ответ на Re: bug or feature, || -operator and NULLs  (Mario Weilguni <mweilguni@sime.com>)
Ответы Re: bug or feature, || -operator and NULLs  (Lukas Kahwe Smith <smith@pooteeweet.org>)
Re: bug or feature, || -operator and NULLs  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: bug or feature, || -operator and NULLs  (Csaba Nagy <nagy@ecircle-ag.com>)
Re: bug or feature, || -operator and NULLs  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Wednesday 18 October 2006 14:44, Mario Weilguni wrote:
> Am Mittwoch, 18. Oktober 2006 13:52 schrieb Andreas Joseph Krogh:
> > This has been been discussed before, but Oracle behaves differently, and
> > IMHO in a more correct way.
> >
> > The following query returns NULL in PG:
> > SELECT NULL || 'fisk';
> >
> > But in Oracle, it returns 'fisk':
> > SELECT NULL || 'fisk' FROM DUAL;
> >
> > The latter seems more logical...
>
> I've worked alot with oracle a few years ago and I agree, the feature is
> handy and makes sometimes life easier, but it's simply wrong. I heard a
> while ago that newer oracle versions changed this to sql - standard, is
> this true?

Oracle(10.1.0.4.0) still treats '' as NULL.

Why do these discussions always end in academic arguments over whats more
logical then not? From a *user's* point of view I really would like it to
treat the NULL operand of || as '', and obviously many other (at least
Oracle) users tend to agree with me on that.

On Wednesday 18 October 2006 14:42, Csaba Nagy wrote:
> And it would really return null, if aggregates wouldn't ignore the NULL
> values altogether... the null values are skipped before they get into
> the summing. The same happens with count, if you specify a column it
> will only count the ones which are not null:

If aggregates ignore NULL one could argue that so shuld the ||-operator?

--
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Karenslyst Allé 11      | know how to do a thing and to watch         |
PO. Box 529 Skøyen      | somebody else doing it wrong, without       |
0214 Oslo               | comment.                                    |
NORWAY                  |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+


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

Предыдущее
От: Michael Paesold
Дата:
Сообщение: Re: Mirror problems for download
Следующее
От: Lukas Kahwe Smith
Дата:
Сообщение: Re: bug or feature, || -operator and NULLs