From: Josh Berkus <josh@agliodbs.com>
To: Gary Stainburn <gary.stainburn@ringways.co.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: search/replace in update
Date: Thu, 14 Jun 2001 07:52:08 -0700
Message-ID: <web-71932@davinci.ethosmedia.com> (raw)
In-Reply-To: <01061409403400.06009@gary.ringways.co.uk>
Gary,
> This means that e.g. all mobile numbers that used to start 0589 now
> start 07889.
>
> Is there a way in SQL to update the phone number in-place?
Postgresql has a nifty string substitution function. For this and other
character manipulation functions, see:
http://www.postgresql.org/idocs/index.php?functions-string.html
You should be able to fairly easily swap out "07889" and replace it with
"0589".
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
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-sql@postgresql.org
Cc: josh@agliodbs.com, gary.stainburn@ringways.co.uk
Subject: Re: search/replace in update
In-Reply-To: <web-71932@davinci.ethosmedia.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