Re: [HACKERS] writing new regexp functions

From: David Fetter <david(at)fetter(dot)org>
To: Jeremy Drake <pgsql(at)jdrake(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] writing new regexp functions
Date: 2007-02-04 15:45:28
Message-ID: 20070204154528.GB13202@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Theo Schlossnagle 2007-02-04 15:53:32 Re: Proposal: Commit timestamp
Previous Message Jan Wieck 2007-02-04 15:06:27 Re: Proposal: Commit timestamp

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-02-04 17:32:32 Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Previous Message Pavel Stehule 2007-02-04 15:19:33 TM formating patch