pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karen Stone <kstone@mhs.mphasis.com>
To: 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, 1 Jul 2008 16:00:15 -0700
Message-ID: <09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com> (raw)
In-Reply-To: <486A59E1.EE98.0025.0@wicourts.gov>
References: <486A9A5E.9070905@mhs.mphasis.com>
	<486A59E1.EE98.0025.0@wicourts.gov>

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 <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#F
UNCTIONS-POSIX-REGEXP
 
Be sure to use a WHERE clause on your UPDATE with the ~ operator.
 
-Kevin

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

-- CONFIDENTIALITY NOTICE --

Information transmitted by this??e-mail is proprietary to MphasiS and/or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is??privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this e-mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records.



view thread (6+ messages)  latest in thread

Message-ID: <09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com>
Permalink:  ../09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com/
Also on:    postgresql.org/message-id/09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com

 · 

reply

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: kstone@mhs.mphasis.com, Kevin.Grittner@wicourts.gov, nwalker@mhs.mphasis.com
  Subject: Re: Change a character in a text field
  In-Reply-To: <09BDF9F0EAD32745A823E1865E6C45F3C99AE3@ecimail.eldocomp.com>

* 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