Re: How to define + operator for strings - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: How to define + operator for strings
Date
Msg-id 20060428194539.GD15566@svana.org
Whole thread Raw
In response to Re: How to define + operator for strings  ("Andrus" <eetasoft@online.ee>)
Responses Re: How to define + operator for strings
List 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.

Attachment

pgsql-general by date:

Previous
From: "Jim Buttafuoco"
Date:
Subject: Re: Autovacuum Logging
Next
From: Bruce Momjian
Date:
Subject: Re: Autovacuum Logging