Re: string_to_array with empty input

From: justin <justin(at)emproshunts(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: string_to_array with empty input
Date: 2009-03-31 16:11:19
Message-ID: 49D240A7.1010009@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Sam Mason wrote:
> I'd expect 3,2,1 and 1.
>
> That's also a disingenuous example; what would you expect back from:
>
> select count_elements(string_to_array('butter,,milk',','))
>
> I think the semantics you want is what you'd get from:
>
> array_filter_blanks(string_to_array($1,$2))
>
> where I defined "array_filter_blanks" in my previous post.
>

I agree the function should not be changing values passed.
Stripping/Dropping empty strings is changing what was passed into the
function instead breaking it into a array.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2009-03-31 16:17:04 Re: how to see how the data is structured in postgreqsql
Previous Message Greg Stark 2009-03-31 16:08:45 Re: string_to_array with empty input

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-03-31 16:21:52 Re: Solaris getopt_long and PostgreSQL
Previous Message Greg Stark 2009-03-31 16:08:45 Re: string_to_array with empty input