From: | Jeremy Drake <pgsql(at)jdrake(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, David Fetter <david(at)fetter(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>, Neil Conway <neilc(at)samurai(dot)com> |
Subject: | Re: patch adding new regexp functions |
Date: | 2007-02-17 19:32:58 |
Message-ID: | Pine.BSO.4.64.0702171124190.18849@resin.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
Finally the voice of reason :)
On Sat, 17 Feb 2007, Tom Lane wrote:
> So I'd vote against complicating the API in order to make special
> provision for these results. I claim that all we need is a function
> taking (string text, pattern text, flags text) and returning either
> array of text or setof text
For this function, it would be setof array of text, as the capture groups
would definitely go in an array, but if you asked for global in the flags,
there could be more than one match in the string.
> containing the matched substrings in
> whatever order is standard (order by left-parenthesis position,
> I think). In the degenerate case where there are no parenthesized
> subpatterns, just return the whole match as a single element.
Good idea, that did not occur to me. I was planning to throw an error in
that case.
> As for the argument about array vs setof, I could see doing both to
> end the argument of which one is really superior for any particular
> problem.
The array vs setof argument was on the split function. I will work on
doing both. Any idea how the name and/or arguments should differ? I
think that an optional limit argument for the array version like perl has
would be reasonable, but a name difference in the functions is probably
necessary to avoid confusion.
--
Speaking of Godzilla and other things that convey horror:
With a purposeful grimace and a Mongo-like flair
He throws the spinning disk drives in the air!
And he picks up a Vax and he throws it back down
As he wades through the lab making terrible sounds!
Helpless users with projects due
Scream "My God!" as he stomps on the tape drives, too!
Oh, no! He says Unix runs too slow! Go, go, DECzilla!
Oh, yes! He's gonna bring up VMS! Go, go, DECzilla!"
* VMS is a trademark of Digital Equipment Corporation
* DECzilla is a trademark of Hollow Chocolate Bunnies of Death, Inc.
-- Curtis Jackson
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2007-02-17 19:40:54 | Re: pg_restore fails with a custom backup file |
Previous Message | Matthew Campbell | 2007-02-17 19:28:28 | Re: GiST Comparing IndexTuples/Datums |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-02-17 19:43:14 | Re: patch adding new regexp functions |
Previous Message | Mark Dilger | 2007-02-17 19:27:06 | Re: patch adding new regexp functions |