Re: [PATCHES] regexp_replace - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [PATCHES] regexp_replace
Date
Msg-id 200506061749.j56Hnsh23388@candle.pha.pa.us
Whole thread Raw
In response to Re: [PATCHES] regexp_replace  (David Fetter <david@fetter.org>)
Responses Re: [PATCHES] regexp_replace  (a_ogawa <a_ogawa@hi-ho.ne.jp>)
List pgsql-hackers
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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Quick-and-dirty compression for WAL backup blocks
Next
From: "Victor Y. Yegorov"
Date:
Subject: adding new pages bulky way