Re: Can I reset the lower bound of an array. - Mailing list pgsql-general

From Joe Conway
Subject Re: Can I reset the lower bound of an array.
Date
Msg-id 4086B97F.4070608@joeconway.com
Whole thread Raw
In response to Re: Can I reset the lower bound of an array.  (Mark Gibson <gibsonm@cromwell.co.uk>)
List pgsql-general
Mark Gibson wrote:
> Mark Gibson wrote:
>
>> b) resetting the lower bound of the array (without affecting elements)?
>>    eg: set_array_lower(1 || ARRAY[2,3,4], 1) -- 2nd arg is the new
>> lower bound

It should be pretty easy to create a C function to reset the lower bound
of an array to some arbitrary value.

Worth noting, however, is that there have been some discussions
regarding the fact that the SQL spec defines arrays as hiving a fixed
lower bound of 1, and that we might need (or at least want) to comply
with that in order to support NULL array elements. I've been hoping to
put together a coherent proposal for such changes, but have
unfortunately not been able to find the time. I'd still like to try to
get agreement and make the changes for 7.5. If anyone has strong
opinions, now would be a good time to get them on the table.

Joe


pgsql-general by date:

Previous
From: Jord Tanner
Date:
Subject: kill -2
Next
From: Bruno Wolff III
Date:
Subject: Re: 7.3.4 on Linux: UPDATE .. foo=foo+1 degrades massivly over time