Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL) - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date
Msg-id CAFj8pRAL553vY60RTYX-xJ=KYiMpdCTPi6+U06rWd5ux1C=m-g@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Responses Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
List pgsql-hackers



2013/4/3 Gavin Flower <GavinFlower@archidevsys.co.nz>
On 04/04/13 03:02, Florian Pflug wrote:
On Apr3, 2013, at 15:30 , Andrew Dunstan <andrew@dunslane.net> wrote:
On 04/02/2013 02:46 PM, Florian Pflug wrote:
If we're going to break compatibility, we should IMHO get rid of
non-zero lower bounds all together. My guess is that the number of
affected users wouldn't be much higher than for the proposed patch,
and it'd allow lossless mapping to most language's native array types…
That would actually break a HUGE number of users, since the default lower
bound is 1. I have seen any number of pieces if code that rely on that.
Uh, yeah, we should make it 1 then, not 0, then. As long as the bound
is fixed, conversion to native C/Java/Ruby/Python/... arrays would still
be lossless.

best regards,
Florian Pflug


Zero as the default lower bound is consistent with most languages (especially the common ones like C, C++, Java, & Python), in fact I don't remember any language where that is not the case (ignoring SQL) - and I've written programs in about 20 languages.

pascal, ADA, and ALGOL like languages

Regards

Pavel


 

Maybe we should adopt the famous compromise of '0.5'?  :-)


Cheers,
Gavin



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: commit dfda6ebaec67 versus wal_keep_segments
Next
From: Tom Lane
Date:
Subject: track_activities is mostly broken