Re: array_to_string bug? - Mailing list pgsql-hackers

From David Fetter
Subject Re: array_to_string bug?
Date
Msg-id 20091112184647.GB13922@fetter.org
Whole thread Raw
In response to Re: array_to_string bug?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: array_to_string bug?
List pgsql-hackers
On Thu, Nov 12, 2009 at 01:33:41PM -0500, Robert Haas wrote:
> On Thu, Nov 12, 2009 at 1:28 PM, Steve Crawford
> <scrawford@pinpointresearch.com> wrote:
> > Although it might cause a fair amount of backward-compatibility
> > trouble, the string representation could either use NULL to
> > represent a null element as is allowed in other contexts or
> > require that empty-string elements be represented as "" to
> > differentiate ,"", (empty-string element) from ,, (null element).
> 
> That would cause a substantial amount of grief to people who might
> not want that behavior, though.  I use these functions for creating
> human-readable output, not for serialization.  Simple, predictable
> behavior is very important.

My question boils down to, "why is this string concatenation different
from all other string concatenations?"

For now, the answer can be, "it behaves differently with respect to
NULLs," and we just document this.  We can later decide whether this
behavior should change.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql GUC variable: custom or built-in?
Next
From: Tom Lane
Date:
Subject: Re: array_to_string bug?