Re: Splitting text column to multiple rows - Mailing list pgsql-general

From Andrus
Subject Re: Splitting text column to multiple rows
Date
Msg-id AFBFB7C89DF44964AB4439B685E92DB1@andrusnotebook
Whole thread Raw
In response to Re: Splitting text column to multiple rows  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Splitting text column to multiple rows
Re: Splitting text column to multiple rows
List pgsql-general
Pavel,

> CREATE OR REPLACE FUNCTION unnest(anyarray)
> RETURNS SETOF anyelement as $$
>  SELECT $1[i] FROM generate_series(1,4) g(i)
> $$ LANGUAGE sql;
>
> pavel@postgres:5481=# select unnest(string_to_array('23,2,3,4,5',','));
> unnest
> --------
> 23
> 2
> 3
> 4
> (4 rows)

Result is wrong: it must contain 5 rows.
How to make this work with with any array size ?

Some lines are long.
How to implement word wrap to new row in 80th position but between words
only ?

Andrus.


pgsql-general by date:

Previous
From: Oliver Kohll - Mailing Lists
Date:
Subject: Re: [pgsql-general] looking for a powerful frontend/teport generator
Next
From: Pavel Stehule
Date:
Subject: Re: Splitting text column to multiple rows