Re: Arrays
От
Steve Crawford
Тема
Re: Arrays
Дата
Msg-id
4E70EF2B.7000507@pinpointresearch.com
Ответ на
Arrays (Bob Pawley)
Список
Дерево обсуждения
Arrays "Bob Pawley" <rjpawley@shaw.ca>
Re: Arrays Steve Crawford <scrawford@pinpointresearch.com>
Re: Arrays Marti Raudsepp <marti@juffo.org>
Re: Arrays Fabrízio de Royes Mello <fabriziomello@gmail.com>
Re: Arrays Merlin Moncure <mmoncure@gmail.com>
On 09/14/2011 11:01 AM, Bob Pawley wrote:
But note that PostgreSQL allows multi-dimensional arrays. The array_dims function gives you all the dimensions. If you have a one-dimensional array you can use array_upper(yourarray, 1) and array_lower(yourarray, 2).
Also be aware that the first element in a PostgreSQL array typically has an index of 1 but does not have to. In fact it is legal to have arrays that start at a negative index and proceed to a positive one.
Cheers,
Steve
Look at array_dims, array_upper and array_lower.HiIs there a method of counting the number of elements in an array??Bob
But note that PostgreSQL allows multi-dimensional arrays. The array_dims function gives you all the dimensions. If you have a one-dimensional array you can use array_upper(yourarray, 1) and array_lower(yourarray, 2).
Also be aware that the first element in a PostgreSQL array typically has an index of 1 but does not have to. In fact it is legal to have arrays that start at a negative index and proceed to a positive one.
Cheers,
Steve
В списке pgsql-general по дате отправления
От: Merlin Moncure
Дата: