Re: How to define + operator for strings

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: How to define + operator for strings
Дата
Msg-id 20060428194539.GD15566@svana.org
обсуждение исходный текст
Ответ на Re: How to define + operator for strings  ("Andrus" <eetasoft@online.ee>)
Ответы Re: How to define + operator for strings  (Geoffrey <esoteric@3times25.net>)
Список pgsql-general
On Fri, Apr 28, 2006 at 07:35:20PM +0300, Andrus wrote:
> > text + text will tend to capture ambiguous cases,
> > and thus possibly break queries that used to work (date + integer is a
> > case that comes to mind as being at risk).
>
> How to add + operator for strings so that  date+integer   expression is not
> broken ?

You can't really. There are 27 meanings for a binary '+' operator and
it's not always easy to work out whats is going to if the underlying
types are not numeric in some sense. Given you're using a system that's
not standards compliant, it would surprise me if you used date+integer
at all.

> > Refusing to deal with databases that can't handle the 14-year-old SQL
> > standard spelling of concatenation would be a better plan IMHO --- if
> > they can't get this right, it's unlikely that they are much better on
> > a lot of other points that will be harder to work around.
>
> I have huge amount of code written for this. Refusing is difficult.

Does it not support the SQL standard way of string concatination? You
should be planning a transition because text+text will cause problems
down the line...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Jim Buttafuoco"
Дата:
Сообщение: Re: Autovacuum Logging
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Autovacuum Logging