Re: CONCAT function

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CONCAT function
Date: 2003-09-16 12:53:39
Message-ID: m3d6e0rj1o.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In the last exciting episode, newsy(at)lewczuk(dot)com ("Marek Lewczuk") wrote:
>> You want to use the || operator, e.g. 'hello' || ' ' || 'world'
>
> I know that, but in my application (which is working on MySQL now) I
> have many querys which use CONCAT function, so I need to implement this
> function is PG - there is no possibility to replace (in short time) all
> of my querys.

Well, then you might implement "CONCAT" in plpgsql.

It will presumably take two values (possibly text, possibly generic),
use ||, inside the function, to catenate them, and then return a text
value.

That should be quite straightforward.
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','ntlug.org').
http://cbbrowne.com/info/lisp.html
Rules of the Evil Overlord #220. "Whatever my one vulnerability is, I
will fake a different one. For example, ordering all mirrors removed
from the palace, screaming and flinching whenever someone accidentally
holds up a mirror, etc. In the climax when the hero whips out a mirror
and thrusts it at my face, my reaction will be ``Hmm...I think I need
a shave.''" <http://www.eviloverlord.com/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-09-16 12:57:07 Re: Odd behaviour -- Index scan vs. seq. scan
Previous Message Shridhar Daithankar 2003-09-16 12:47:00 Re: CONCAT function