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

From Robert Treat
Subject Re: [PATCHES] regexp_replace
Date
Msg-id 200506081314.37469.xzilla@users.sourceforge.net
Whole thread Raw
In response to Re: [PATCHES] regexp_replace  (David Fetter <david@fetter.org>)
Responses Re: [PATCHES] regexp_replace  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: The Contrib Roundup (long)
Next
From: Alvaro Herrera
Date:
Subject: Re: The Contrib Roundup (long)