Re: string_to_array with an empty input string - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: string_to_array with an empty input string
Date
Msg-id 4455DAAC-40AF-42B3-8AE8-7710C224A01C@kineticode.com
Whole thread Raw
In response to Re: string_to_array with an empty input string  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: string_to_array with an empty input string
List pgsql-hackers
On Aug 11, 2010, at 7:41 AM, Tom Lane wrote:

> I had forgotten that discussion.  It looks like we trailed off without
> any real consensus: there was about equal sentiment for an array with
> zero elements and an array with one empty-string element.  We ended
> up leaving it alone because (a) that wouldn't break anything and (b)
> you could use COALESCE() to substitute whichever behavior your
> application needed for the case.
> 
> So maybe we need to revisit the issue.  Pavel was claiming that
> switching to a zero-element array result was a no-brainer, but evidently
> it isn't so.  Is anybody still excited about the alternatives?

% perl -E 'say q{"}, join(",", ""), q{"}'
""
% ruby -e 'puts %q{"} + [""].join(",") + %q{"}'
""
% python -c 'print "\"" + ",".join([""]) + "\""'
""

I believe those are all "", rather than '"' + undef + '"'.

Best,

David


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Regression tests versus the buildfarm environment
Next
From: Tom Lane
Date:
Subject: Re: review: psql: edit function, show function commands patch