pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5831: Splitting string into char array with string_to_array does not work
3+ messages / 3 participants
[nested] [flat]

* BUG #5831: Splitting string into char array with string_to_array does not work
@ 2011-01-11 15:44 Splitting string into char array with string_to_array <valgog@gmail.com>
  2011-01-11 16:16 ` Re: BUG #5831: Splitting string into char array with string_to_array does not work Tom Lane <tgl@sss.pgh.pa.us>
  2011-01-11 20:01 ` Re: BUG #5831: Splitting string into char array with string_to_array does not work Pavel Stehule <pavel.stehule@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Splitting string into char array with string_to_array @ 2011-01-11 15:44 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      5831
Logged by:          Splitting string into char array with string_to_array
Email address:      valgog@gmail.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: 

    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?



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5831: Splitting string into char array with string_to_array does not work
  2011-01-11 15:44 BUG #5831: Splitting string into char array with string_to_array does not work Splitting string into char array with string_to_array <valgog@gmail.com>
@ 2011-01-11 16:16 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2011-01-11 16:16 UTC (permalink / raw)
  To: Splitting string into char array with string_to_array <valgog@gmail.com>; +Cc: pgsql-bugs

"Splitting string into char array with string_to_array" <valgog@gmail.com> writes:
> 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.

Really?  I get this in all versions since 7.4, where string_to_array was
introduced:

regression=# select string_to_array('ab', '' );
 string_to_array 
-----------------
 {ab}
(1 row)

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5831: Splitting string into char array with string_to_array does not work
  2011-01-11 15:44 BUG #5831: Splitting string into char array with string_to_array does not work Splitting string into char array with string_to_array <valgog@gmail.com>
@ 2011-01-11 20:01 ` Pavel Stehule <pavel.stehule@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Pavel Stehule @ 2011-01-11 20:01 UTC (permalink / raw)
  To: Splitting string into char array with string_to_array <valgog@gmail.com>; +Cc: pgsql-bugs

2011/1/11 Splitting string into char array with string_to_array
<valgog@gmail.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@gmail.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-01-11 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-11 15:44 BUG #5831: Splitting string into char array with string_to_array does not work Splitting string into char array with string_to_array <valgog@gmail.com>
2011-01-11 16:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-01-11 20:01 ` Pavel Stehule <pavel.stehule@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox