Skip site navigation (1) Skip section navigation (2)

Re: BUG #5831: Splitting string into char array with string_to_array does not work

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Splitting string into char array with string_to_array <valgog(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5831: Splitting string into char array with string_to_array does not work
Date: 2011-01-11 20:01:37
Message-ID: AANLkTikFOLgsA4dn3FwUDEpV-2cGs91KGxZCrsw2xHEL@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
2011/1/11 Splitting string into char array with string_to_array
<valgog(at)gmail(dot)com>:
>
> The following bug has been logged online:
>
> Bug reference:      5831
> Logged by:          Splitting string into char array with string_to_array
> Email address:      valgog(at)gmail(dot)com
> PostgreSQL version: 9.0.1
> Operating system:   Ubuntu/Linaro 4.4.4-14ubuntu5
> Description:        Splitting string into char array with string_to_array
> does not work
> Details:
>
> Hi,
>
> I cannot really remember now for sure, but the splitting string into array
> using an empty string ('') worked for me on pre-9.0 versions to get array of
> string chars. Now I have the following behavior:

Hello

it's newer worked like you remember

postgres=# select regexp_split_to_array('abc','');
 regexp_split_to_array
-----------------------
 {a,b,c}
(1 row)

Regards

Pavel Stehule


>
>    postgres=# select string_to_array('ab', '' ),
> regexp_split_to_array('ab', '' );
>     string_to_array │ regexp_split_to_array
>
> ─────────────────┼───────â
> ��───────────────
>     {ab}            │ {a,b}
>    (1 row)
>
> Why an empty string given as a separator to string_to_array is not splitting
> the string at all?
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>

In response to

pgsql-bugs by date

Next:From: Robert HaasDate: 2011-01-12 16:00:29
Subject: Re: BUG #5809: bigserial duplicate value
Previous:From: Tom LaneDate: 2011-01-11 18:05:04
Subject: Re: domain over enum problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group