Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

Next:From: Theo SchlossnagleDate: 2007-02-04 15:53:32
Subject: Re: Proposal: Commit timestamp
Previous:From: Jan WieckDate: 2007-02-04 15:06:27
Subject: Re: Proposal: Commit timestamp

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group