Re: translate function - Mailing list pgsql-general

From Steve Crawford
Subject Re: translate function
Date
Msg-id 20030502151921.402DD103C7@polaris.pinpointresearch.com
Whole thread Raw
In response to translate function  ("Don V. Soledad" <don.soledad@uratex.com.ph>)
List pgsql-general
In 7.3.x:

select replace('Juan dela Cruz C/O ABC Co.'::text,'C/O'::text,'c/o'::text);
          replace
----------------------------
 Juan dela Cruz c/o ABC Co.
(1 row)

Cheers,
Steve

On Thursday 01 May 2003 8:46 pm, Don V. Soledad wrote:
> good day!
>
> how could i use the function translate to output the replacement of the
> exact occurrence of the 2nd parameter?
>
> for instance,
>     select translate('Juan dela Cruz C/O ABC Co.','C/O','c/o');
> gives
>              translate
>     ----------------------------
>      Juan dela cruz c/o ABc co.
>
> i would like the output to be "Juan dela Cruz c/o ABC Co." instead of "Juan
> dela cruz c/o ABc co." could i do this with the above function, or are
> there any functions that could do this?
>
> thank you very much!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Slow Queries with OR's?
Next
From: Bruno Wolff III
Date:
Subject: Re: TIMEZONE Problem