Re: writing new regexp functions

Поиск
Список
Период
Сортировка
От Jeremy Drake
Тема Re: writing new regexp functions
Дата
Msg-id Pine.BSO.4.64.0702011658050.28908@resin.csoft.net
обсуждение исходный текст
Ответ на Re: writing new regexp functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: writing new regexp functions
Список pgsql-hackers
On Thu, 1 Feb 2007, Tom Lane wrote:

> Jeremy Drake <pgsql@jdrake.com> writes:
> > Is there some specific reason that these functions are static,
>
> Yeah: not cluttering the global namespace.

> Is there a reason for not putting your new code itself into regexp.c?

Not really, I just figured it would be cleaner/easier to write it as an
extension.  I also figure that it is unlikely that every regexp function
that anyone could possibly want will be implemented in core in that one
file.  If anyone writes an extension like this, they would need to
duplicate a good amount of code in order to do so, that would make more
difficulty in maintaining the code if it should need to change.  It also
makes developing a new function a lot easier, no need to re-initdb to add
the function, no need to relink the postmaster and restart it every time
the function changes.

Anyway, the particular thing I was writing was a function like
substring(str FROM pattern) which instead of returning just the first
match group, would return an array of text containing all of the match
groups.  I exported the functions in my sandbox, and wrote a module with a
function that does this.

>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
>

-- 
Calling J-Man Kink.  Calling J-Man Kink.  Hash missile sighted, target
Los Angeles.  Disregard personal feelings about city and intercept.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Full page writes improvement
Следующее
От: Kate F
Дата:
Сообщение: Function proposal to find the type of a datum