Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-11 Thread James William Pye
On 08/06/04:31/5, Joe Conway wrote: I just reread your comment and thought about it more. I think most of what I said in the last post holds, but in addition part of the problem lies in the fact that we don't implement multidimensional arrays as nested arrays, but rather as one monolithic

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-08 Thread Joe Conway
Tom Lane wrote: Joe Conway [EMAIL PROTECTED] writes: select '{{},{}}'::text[]; ERROR: malformed array literal: {{},{}} Hm. This seems like it would be a legitimate representation of a 2x0 array. Why would you allow '{}' and reject this? Well, '{}' is a special case representing an empty array.

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange

2004-08-08 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Tom Lane wrote: [ random griping ] Well, '{}' is a special case representing an empty array. Hmm ... good point ... it is not obvious whether that is an empty array (0x0) or a 1x1 array containing a single zero-length string. I guess if we want to make

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-08 Thread Joe Conway
Tom Lane wrote: Joe Conway [EMAIL PROTECTED] writes: select '{{},{}}'::text[]; ERROR: malformed array literal: {{},{}} Hm. This seems like it would be a legitimate representation of a 2x0 array. Why would you allow '{}' and reject this? I just reread your comment and thought about it more. I

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-08 Thread Joe Conway
Tom Lane wrote: I'm not sure that we had such an agreement, but in any case we've got to understand how to distinguish empty-string from NULL. I realized that in my followup post regarding nested arrays. In any case, since will not 8.0 support either NULL elements nor nested arrays, can we agree

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-06 Thread Joe Conway
Tom Lane wrote: 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.

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange

2004-08-06 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: The attached patch suppresses trailing whitespace, but allows embedded whitespace in unquoted elements as discussed above. It also rejects some previously accepted cases that were just too strange to be correct: -- Postgres 8.0, with the patch -- none

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields

2004-08-05 Thread Joe Conway
Joe Conway wrote: I'm hesitant to apply the attached this late before the beta without review, but it seems to take care of the pathological cases I came up with, doesn't break anything AFAICS, and passes all regression tests. I guess it can go into beta 2. I've continued to hack on array

Re: [HACKERS] [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange

2004-08-05 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] 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