Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 683F6650EB3 for ; Tue, 1 Jul 2008 22:50:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58277-05 for ; Tue, 1 Jul 2008 22:50:18 -0300 (ADT) X-Greylist: delayed 00:08:35.228944 by SQLgrey-1.7.6 Received: from elasmtp-curtail.atl.sa.earthlink.net (elasmtp-curtail.atl.sa.earthlink.net [209.86.89.64]) by postgresql.org (Postfix) with ESMTP id ACE2B650EA7 for ; Tue, 1 Jul 2008 22:50:23 -0300 (ADT) Received: from [66.167.133.223] (helo=[192.168.1.3]) by elasmtp-curtail.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1KDrLu-0007FZ-9a; Tue, 01 Jul 2008 21:41:46 -0400 Message-ID: <486ADCD8.4050704@eldocomp.com> Date: Tue, 01 Jul 2008 18:41:44 -0700 From: Naomi Walker User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: pgsql-admin@postgresql.org CC: Kevin Grittner Subject: Re: Change a character in a text field References: <486A9A5E.9070905@mhs.mphasis.com> <486A59E1.EE98.0025.0@wicourts.gov> <09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com> In-Reply-To: <09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: 63cf213987b2dd94c8ad50643b1069f8239a348a220c260947d6b058f953df30caef0430b60c06313ca473d225a0f487350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 66.167.133.223 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/20 X-Sequence-Number: 29630 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@postgresql.org > [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Kevin Grittner > Sent: Tuesday, July 01, 2008 2:23 PM > To: Naomi Walker; pgsql-admin@postgresql.org > Subject: Re: [ADMIN] Change a character in a text field > > >>>> Naomi Walker 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 > >