Re: casting strings to multidimensional arrays yields strange

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: casting strings to multidimensional arrays yields strange
Date: 2004-07-28 04:38:34
Message-ID: 41072DCA.5040206@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-07-28 10:03:53 BUG #1202: Primary Key constraint not respected
Previous Message Tom Lane 2004-07-27 16:41:04 Re: casting strings to multidimensional arrays yields strange results

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-07-28 07:39:57 Re: No mail?
Previous Message Gavin Sherry 2004-07-28 04:17:35 Create database and tablespaces

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2004-07-28 06:31:22 Re: [subxacts] Fixing TODO items
Previous Message Christopher Kings-Lynne 2004-07-28 04:10:47 USING INDEX TABLESPACE