Re: [GENERAL] string_to_array with empty input - Mailing list pgsql-hackers

From justin
Subject Re: [GENERAL] string_to_array with empty input
Date
Msg-id 49D240A7.1010009@emproshunts.com
Whole thread Raw
In response to Re: [GENERAL] string_to_array with empty input  (Sam Mason <sam@samason.me.uk>)
List 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.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Solaris getopt_long and PostgreSQL
Next
From: justin
Date:
Subject: Re: [GENERAL] string_to_array with empty input