Re: regexp_replace

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: "a_ogawa00" <a_ogawa00(at)yahoo(dot)co(dot)jp>, pgsql-patches(at)postgresql(dot)org, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: regexp_replace
Date: 2005-06-06 17:49:54
Message-ID: 200506061749.j56Hnsh23388@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

David Fetter wrote:
> On Mon, Jun 06, 2005 at 12:02:18PM -0400, Bruce Momjian wrote:
> >
> > Patch removed because we already have this functionality.
>
> We don't yet have this functionality, as the patch allows for using
> second and later regex matches "()" in the replacement pattern.
>
> The function is misnamed. It should be called regex_replace_all() or
> some such, as it violates the principle of least astonishment by
> replacing all instances by default. Every other regex replacement
> defaults to "replace first," not "replace all." Or maybe it should
> take a bool for "replace all," or...? Anyhow, it's worth a discussion
> :)

Does anyone want to argue that this additional functionality is
significant and deserves its own function or an additional argument to
the existing function?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Edward Peschko 2005-06-06 19:52:13 mirroring oracle database in pgsql
Previous Message Tom Lane 2005-06-06 17:09:42 Re: Quick-and-dirty compression for WAL backup blocks

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-06 17:54:25 Re: uptime function to postmaster
Previous Message Euler Taveira de Oliveira 2005-06-06 17:33:37 Re: uptime function to postmaster