Re: Function returning SETOF - Mailing list pgsql-general

From Terry Lee Tucker
Subject Re: Function returning SETOF
Date
Msg-id 200512020404.38005.terry@esc1.com
Whole thread Raw
In response to Re: Function returning SETOF  (David Fetter <david@fetter.org>)
List pgsql-general
Simpler is better ;o)

Thanks for the input...

On Thursday 01 December 2005 10:31 pm, David Fetter saith:
> On Thu, Dec 01, 2005 at 12:32:02PM -0500, Terry Lee Tucker wrote:
> > List,
> >
> > I have a simple function:
>
> I have a simpler one :)
>
> CREATE OR REPLACE FUNCTION split_to_rows(TEXT, TEXT) /* Descriptive name */
> RETURNS SETOF TEXT
> STRICT
> LANGUAGE sql
> AS $$
>     SELECT (string_to_array($1, $2))[s.i]
>     FROM generate_series(
>         1,
>         array_upper(string_to_array($1, $2), 1)
>     ) AS s(i);
> $$;
>
> Cheers,
> D
>

pgsql-general by date:

Previous
From: Cott Lang
Date:
Subject: Re: postmaster / resolv.conf / dns problem
Next
From: Richard Huxton
Date:
Subject: Re: PostgresSQL Halting System Boot