Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange
Date
Msg-id 4201.1091751450@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields  (Joe Conway <mail@joeconway.com>)
Responses Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> ... whitespace just before the delimiter is 
> significant (even though leading whitespace is not)

Yeah.  This has been the documented behavior for quite some time, but
I can't say that I ever liked it.

> I view the current behavior as a bug. While making changes, I'd like to 
> require elements with embedded whitespace to be quoted so that the above 
> does this:

> regression=# select '{0 second,0 second}'::text[];
> ERROR:  malformed array literal: "{0 second,0 second}"

> Additionally I'd like to make whitespace before and after quoted or 
> unquoted elements insignificant. Any comments?

I think that suppressing unquoted trailing whitespace is probably
reasonable.  I'm much less enthusiastic about rejecting unquoted
embedded whitespace, though.  I think that's significantly likely
to break apps, and it doesn't seem like it's really needed to have
sane behavior.  The leading/trailing whitespace asymmetry is just
weird, but it doesn't follow that embedded whitespace is weird.

If we are going to make such changes, 8.0 is the right time to do it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: 8.0 beta status
Next
From: David Fetter
Date:
Subject: Re: 8.0 beta status