Re: casting strings to multidimensional arrays yields strange - Mailing list pgsql-bugs

From Joe Conway
Subject Re: casting strings to multidimensional arrays yields strange
Date
Msg-id 41072DCA.5040206@joeconway.com
Whole thread Raw
In response to Re: casting strings to multidimensional arrays yields strange results  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: casting strings to multidimensional arrays yields strange results
List pgsql-bugs
Tom Lane wrote:
> Right now I think the sanest behavior would be to throw an error on
> non-rectangular input.  Once we have support for null elements in
> arrays, however, it would arguably be reasonable to pad with NULLs
> where needed, so that the above would be read as
>
>     {{1,2},{2,3},{4,NULL}}
>
>     {{1,NULL},{2,3},{4,5}}
>
> respectively.  If that's the direction we want to head in, it would
> probably be best to leave array_in alone until we can do that; users
> tend to get unhappy when we change behavior repeatedly.

I think that even once we support NULL array elements, they should be
explicitly requested -- i.e. throwing an error on non-rectangular input
is still the right thing to do. I haven't suggested that in the past
because of the backward-compatibility issue, but maybe now is the time
to bite the bullet.

If you think this qualifies as a bug fix for 7.5, I can take a look at
it next week.

Joe

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: casting strings to multidimensional arrays yields strange results
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1202: Primary Key constraint not respected