Re: [HACKERS] regexp_replace

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2005-06-08 17:22:30 Re: The Contrib Roundup (long)
Previous Message Tom Lane 2005-06-08 16:38:42 Re: The Contrib Roundup (long)

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-08 18:45:46 Re: [HACKERS] regexp_replace
Previous Message Federico Di Gregorio 2005-06-08 16:54:08 BUG #1707: statistics collector starts with stats_start_collector = false