Search Postgresql Archives

Re: Function returning SETOF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux