Search Postgresql Archives

Re: Splitting text column to multiple rows

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

 



"Andrus" <kobruleht2@xxxxxx> writes:
> I changed unction name and tried:
> CREATE OR REPLACE FUNCTION unnest21(anyarray)
> RETURNS SETOF anyelement as $$
>   SELECT $1[i] FROM generate_series(1,4) g(i)
> $$ LANGUAGE sql;

> select unnest21(string_to_array('23,2,3,4,5',','));

> In this case it returns only 4 rows.
> No idea what is happening.

Well, the generate_series call is wrong for this use ...

I think if it appeared to work before it was because the built-in
unnest() function was capturing the call.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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