Re: Open 7.3 items - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Open 7.3 items
Date
Msg-id 1029338857.19985.5.camel@taru.tm.ee
Whole thread Raw
In response to Re: Open 7.3 items  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
On Wed, 2002-08-14 at 16:08, Joe Conway wrote:
> I already have a function in contrib/dblink, currently called 
> dblink_strtok(), which I was going to turn into a builtin function per 
> recent discussion (renamed of course). It would work for this but is 
> more general:
> 
> dblink_strtok(text inputstring, text delimiter, int posn) RETURNS text
> 
> Inputs
>    inputstring
>      any string you want to parse a token out of;
>      e.g. 'f=1&g=3&h=4'
>    delimiter
>      a single character to use as the delimiter;
>      e.g. '&' or '='
>    posn
>      the position of the token of interest, 0 based;
>      e.g. 1
> 
> Should it be called splitstr() (similar to substr())?

What about functions

1. split(text,text,int) returns text

2. split(text,text) returns text[]

and why not

3. split(text,text,text) returns text

which returns text from $1 delimited by $2 and $3

-------------
Hannu



pgsql-hackers by date:

Previous
From: Greg Copeland
Date:
Subject: Re: OOP real life example (was Re: Why is MySQL more
Next
From: Gavin Sherry
Date:
Subject: Re: Better handling of parse errors