Re: [HACKERS] writing new regexp functions - Mailing list pgsql-patches

From David Fetter
Subject Re: [HACKERS] writing new regexp functions
Date
Msg-id 20070204154528.GB13202@fetter.org
Whole thread Raw
In response to Re: [HACKERS] writing new regexp functions  (Jeremy Drake <pgsql@jdrake.com>)
Responses Re: [HACKERS] writing new regexp functions
List pgsql-patches
On Fri, Feb 02, 2007 at 07:01:33PM -0800, Jeremy Drake wrote:

> Let me know if you see any bugs or issues with this code, and I am
> open to suggestions for further regression tests ;)

> Things that I still want to look into:
> * regexp flags (a la regexp_replace).

One more text field at the end is how the regexp_replace() one does
it.

> * maybe make regexp_matches return setof whatever, if given a 'g' flag
>   return all matches in string.

This is doable with current machinery, albeit a little clumsily.

> * maybe a join function that works as an aggregate
>    SELECT join(',', col) FROM tbl
>   currently can be written as
>    SELECT array_to_string(ARRAY(SELECT col FROM tbl), ',')

The array_accum() aggregate in the docs works OK for this purpose.

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!

pgsql-patches by date:

Previous
From: "Pavel Stehule"
Date:
Subject: TM formating patch
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...