Re: patch adding new regexp functions - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: patch adding new regexp functions
Date
Msg-id 200702181832.43132.peter_e@gmx.net
Whole thread Raw
In response to Re: patch adding new regexp functions  (Jeremy Drake <pgsql@jdrake.com>)
Responses Re: patch adding new regexp functions  (Jeremy Drake <pgsql@jdrake.com>)
List pgsql-patches
Jeremy Drake wrote:
> > 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.
>
> regexp_split(string text, pattern text[, flags text]) returns setof
> text
>
> regexp_split_array(string text, pattern text[. flags text[, limit
> int]]) returns text[]

Since you are not splitting an array but returning an array, I would
think that "regexp_split_to_array" would be better, and the other
should then be "regexp_split_to_table".

But why does the second one have a limit and the first one doesn't?  Is
this because you rely on the LIMIT clause to do the same?  Is there a
guarantee that LIMIT on a table function makes a consistent order?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: patch for contrib/xml2
Next
From: Andrew Dunstan
Date:
Subject: Re: further bootstrap cleanup