Re: [HACKERS] regexp_replace

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: David Fetter <david(at)fetter(dot)org>, Atsushi Ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>, pgsql-patches(at)postgresql(dot)org, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] regexp_replace
Date: 2005-06-08 18:45:46
Message-ID: 200506081845.j58Ijks20505@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(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

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2005-06-08 18:46:20 Re: The Contrib Roundup (long)
Previous Message Tom Lane 2005-06-08 18:32:04 Re: The Contrib Roundup (long)

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-08 20:29:20 Re: AT TIME ZONE with full timezones
Previous Message Robert Treat 2005-06-08 17:14:37 Re: [HACKERS] regexp_replace