Re: Function returning SETOF

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Function returning SETOF
Date: 2005-12-02 09:04:38
Message-ID: 200512020404.38005.terry@esc1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-12-02 09:12:21 Re: PostgresSQL Halting System Boot
Previous Message Simon Riggs 2005-12-02 08:57:14 Re: Numeric 508 datatype