Re: Orafce concat operator - Mailing list pgsql-general

From Yeb Havinga
Subject Re: Orafce concat operator
Date
Msg-id 4B72D74B.7040903@gmail.com
Whole thread Raw
In response to Re: Orafce concat operator  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Orafce concat operator  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Pavel Stehule wrote:
>> What about adding something like operator ||| in the orafce package for
>> concat?
>>
>
> no, it could be confusing and it isn't enough, because it isn't only
> || or concat problem. On Oracle empty string is equal to NULL and NULL
> is equal to empty string.
>
> example: '' is null, length('')
>
> http://www.thunderguy.com/semicolon/2003/04/26/oracle-empty-string-null/
>
> so we are not able emulate this behave.
>
Hi Pavel,

Thanks for your quick reply. What you say is entirely true, however I'm
not sure if you completely understood my question, so please do not be
offended if I try to elaborate it a bit:

I did not ask for full '' = NULL emulation, only for an operator to
match the concat function, so that code conversion with repetetive
concats are easier (string || string || string etc) which occur
frequently. Ofcourse a translator can be made that converst that to
concat(string,concat(string,concat(string etc))), however that's
confusing too in a different way. So imho the only problem is to think
of an operator that somehow resembles || so the programmer recognizes a
concat, but also adds something so the programmer recognizes: not
strict. What about ||+ ?

And then, at the conversion of e.g. (string || string || string) IS
NULL, confusion arises, but this is not due to the concat, but more to
the IS NULL clause together with the strange '' = null, and that must be
handled otherwise.

So the operator would speed up part of the code conversion.

regards,
Yeb Havinga




pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PERFORM] PostgreSQL - case studies
Next
From: Pavel Stehule
Date:
Subject: Re: Orafce concat operator