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

From Bruce Momjian
Subject Re: [PATCHES] regexp_replace
Date
Msg-id 200506081845.j58Ijks20505@candle.pha.pa.us
Whole thread Raw
In response to Re: [PATCHES] regexp_replace  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Robert Treat wrote:
> On Tuesday 07 June 2005 10:57, David Fetter wrote:
> > On Tue, Jun 07, 2005 at 10:27:28PM +0900, Atsushi Ogawa wrote:
> > > My idea is opposite. I think that the regexp_replace() should make
> > > "replace all" a default. Because the replace() of pgsql replaces all
> > > string, and regexp_replace() of oracle10g is also similar.
> >
> > I respectfully disagree.  Although Oracle does things this way, no
> > other regular expression search and replace does.  Historically, you
> > can find that "Oracle does it this way" is not a reason why we would
> > do it.  Text editors, programming languages, etc., etc. do "replace
> > the first" by default and "replace globally" only when told to.
> >
>
> You don't think it will be confusing to have a function called replace which
> replaces all occurrences and a function called regex_replace which only
> replaces the first occurance?  There's something to be said for consitancy
> within pgsql itself.

Huh?  I am confused.  Why if both support regex, why does regex_replace
only do the first one?

--
  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: Alvaro Herrera
Date:
Subject: Re: The Contrib Roundup (long)
Next
From: Alvaro Herrera
Date:
Subject: Re: Request for Comments: ALTER [OBJECT] SET SCHEMA