Skip site navigation (1) Skip section navigation (2)

Re: casting strings to multidimensional arrays yields strange results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-bugs(at)postgresql(dot)org,pgsql-hackers(at)postgresql(dot)org
Subject: Re: casting strings to multidimensional arrays yields strange results
Date: 2004-07-28 13:51:58
Message-ID: 21262.1091022718@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-patches
[ cc'ing pghackers in case anyone wants to object ]

Joe Conway <mail(at)joeconway(dot)com> writes:
> 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.

Okay with me.  Anyone on pghackers not happy?

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

Yeah, we can call it a bug fix.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2004-07-28 14:22:42
Subject: Re: [HACKERS] Cannot initdb in cvs tip
Previous:From: Andrew DunstanDate: 2004-07-28 12:39:15
Subject: Re: [HACKERS] Cannot initdb in cvs tip

pgsql-bugs by date

Next:From: Kris JurkaDate: 2004-07-29 20:58:06
Subject: 7.5dev assertion failure w/ v3 protocol and transactions
Previous:From: PostgreSQL Bugs ListDate: 2004-07-28 10:03:53
Subject: BUG #1202: Primary Key constraint not respected

pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-07-28 14:22:42
Subject: Re: [HACKERS] Cannot initdb in cvs tip
Previous:From: Andrew DunstanDate: 2004-07-28 12:39:15
Subject: Re: [HACKERS] Cannot initdb in cvs tip

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group