Search Postgresql Archives

Re: How to define + operator for strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux