From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Naomi Walker <nwalker@mhs.mphasis.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Change a character in a text field
Date: Tue, 01 Jul 2008 16:22:48 -0500
Message-ID: <486A59E1.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <486A9A5E.9070905@mhs.mphasis.com>
References: <486A9A5E.9070905@mhs.mphasis.com>
>>> Naomi Walker <nwalker@mhs.mphasis.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#FUNCTIONS-POSIX-REGEXP
Be sure to use a WHERE clause on your UPDATE with the ~ operator.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, nwalker@mhs.mphasis.com
Subject: Re: Change a character in a text field
In-Reply-To: <486A59E1.EE98.0025.0@wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox