definitions of regexp functions required

Started by Ehsan Haqabout 16 years ago3 messagesgeneral
Jump to latest
#1Ehsan Haq
ehsan_haq98@yahoo.com

Hi,
   I am using a relatively older version of Postgres and I need to use the following functions.
regexp_matches(), regexp_split_to_array(), and regexp_split_to_table() . Can anybody provide me the definitions of these functions.
 
Thanks in advance
Ehsan

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Ehsan Haq (#1)
Re: definitions of regexp functions required

Ehsan Haq wrote:

I am using a relatively older version of Postgres and I
need to use the following functions.
regexp_matches(), regexp_split_to_array(), and
regexp_split_to_table() . Can anybody provide me the
definitions of these functions.

Do you mean the implementation?
That's here:
http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/regexp.c

Yours,
Laurenz Albe

#3Craig Ringer
craig@2ndquadrant.com
In reply to: Ehsan Haq (#1)
Re: definitions of regexp functions required

On 18/03/2010 8:13 PM, Ehsan Haq wrote:

Hi,
I am using a relatively older version of Postgres

What version exactly?

and I need to use the
following functions.
regexp_matches(), |regexp_split_to_array()|, and
|regexp_split_to_table()| . Can anybody provide me the definitions of
these functions.

They're written in C. You can't simply "CREATE FUNCTION ..." them in an
older version of Pg.

You could possibly port them to an older version as an add-in module
(using pgxs to build it), then load them as C functions. I would be
reluctant to try that myself, though, since you'd just be throwing the
work away when you upgrade.

--
Craig Ringer