Can I reset the lower bound of an array.
От | Mark Gibson |
---|---|
Тема | Can I reset the lower bound of an array. |
Дата | |
Msg-id | 40854040.40106@cromwell.co.uk обсуждение исходный текст |
Ответы |
Re: Can I reset the lower bound of an array.
|
Список | pgsql-general |
Hi, I've been playing about with array's, and found the concat operator '||' quite useful, apart from the fact that prepending an element places it in a lower subscript. Is there a way of either: a) prepending an element, but shifting existing elements up a subscript, so that the lower bound remains the same? eg: 1 ||> ARRAY[2,3,4] -- new operator ||> shift array and prepend or 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 Also, while on the topic of array's: Is there any way to specify array slices from a subscript to the beginning or end of an array? eg: element to end: array[5:*] beginning to element: array[*:5] At present it is possible by using an extreme +ve or -ve subscript value, but this isn't nice. Cheers -- Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk> Web Developer & Database Admin Cromwell Tools Ltd. Leicester, England.
В списке pgsql-general по дате отправления: