Re: Splitting text column to multiple rows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <kobruleht2(at)hot(dot)ee>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Splitting text column to multiple rows
Date: 2010-03-29 15:00:34
Message-ID: 13151.1269874834@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andrus" <kobruleht2(at)hot(dot)ee> writes:
> Pavel,
>> pavel(at)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.

Surely that's a copy-and-paste mistake? I get 5 rows from this example.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2010-03-29 15:02:42 Re: Splitting text column to multiple rows
Previous Message Rick Casey 2010-03-29 14:55:13 Re: optimizing import of large CSV file into partitioned table?