Re: string_to_array with an empty input string

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: string_to_array with an empty input string
Date: 2010-08-11 16:23:49
Message-ID: 4455DAAC-40AF-42B3-8AE8-7710C224A01C@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-08-11 16:28:44 Re: review: psql: edit function, show function commands patch
Previous Message Tom Lane 2010-08-11 15:55:52 Re: Regression tests versus the buildfarm environment