Re: Change a character in a text field

From: Naomi Walker <nwalker(at)eldocomp(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Re: Change a character in a text field
Date: 2008-07-02 01:41:44
Message-ID: 486ADCD8.4050704@eldocomp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Karen Stone wrote:
> Can you please provide a complete example of how to use this in the
> update command? ie... how do we select the table/field that we want to
> interrogate and make the change to?
>
> Thanks!
>
> Karen Stone
> Technical Services
> MphasiS Health Solutions
> 602.604.3100 x265
>
> -----Original Message-----
> From: pgsql-admin-owner(at)postgresql(dot)org
> [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Kevin Grittner
> Sent: Tuesday, July 01, 2008 2:23 PM
> To: Naomi Walker; pgsql-admin(at)postgresql(dot)org
> Subject: Re: [ADMIN] Change a character in a text field
>
>
>>>> Naomi Walker <nwalker(at)mhs(dot)mphasis(dot)com> wrote:
>>>>
>> Is there some way with a SQL state to interrogate a text field, and
>> replace characters.
>>
>> For example, we would like all "|"'s to be changed to something else,
>>
> on
>
>> a regular basis...
>>
>
> It sounds like you might want to look at the regexp_replace function:
>
> http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#F
> UNCTIONS-POSIX-REGEXP
>
> Be sure to use a WHERE clause on your UPDATE with the ~ operator.
>
> -Kevin
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message kevin kempter 2008-07-02 02:13:39 strange drop errors
Previous Message Rafael Domiciano 2008-07-02 01:24:49 Re: Configuring Shared Buffers