Received: from wolff.to (wolff.to [66.92.219.49] (may be forged)) by postgresql.org (8.11.3/8.11.4) with SMTP id fB6K6cm97024 for ; Thu, 6 Dec 2001 15:06:38 -0500 (EST) (envelope-from bruno@[66.92.219.49]) Received: (qmail 22453 invoked by uid 500); 6 Dec 2001 20:05:32 -0000 Date: Thu, 6 Dec 2001 14:05:32 -0600 From: Bruno Wolff III To: Vigny Christophe Cc: pgsql-sql@postgresql.org Subject: Re: update with RE Message-ID: <20011206140532.A22419@wolff.to> Mail-Followup-To: Vigny Christophe , pgsql-sql@postgresql.org References: <3C0B8012.215C8AC1@artprice.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C0B8012.215C8AC1@artprice.com>; from cvigny@artprice.com on Mon, Dec 03, 2001 at 02:37:22PM +0100 X-Archive-Number: 200112/81 X-Sequence-Number: 5904 On Mon, Dec 03, 2001 at 02:37:22PM +0100, Vigny Christophe wrote: > hello, > > Is it possible to use a Regular expression to update a field like in > perl (s/T/t/) > ie : > update table set name=($1) where name ~* '.*(phe).*' > substitute using a grouping function $1 is in fact 'phe'. > > It should be really interesting and powerfull ! You would have to write a function to do this. There is a note about this in the 7.2 documentation.