| От | Tom Lane |
|---|---|
| Тема | Re: Alter table with arrays |
| Дата | |
| Msg-id | 635.964456894@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Alter table with arrays (igor <igor_kh@mailru.com>) |
| Список | pgsql-novice |
igor <igor_kh@mailru.com> writes:
> Help me please to alter table with arrays .
> And now I would like to increase the number of colomns of array from
> two to tree. What is the way to fulfill these operation?
As of 7.0.*, the only way to change the size of an array is to replace
the whole array, ie,
UPDATE table SET arraycol = '{ .... }'
I have recently fixed the array code so that you can enlarge an array
by assigning to an element or slice. For example, given an array with
current dimensions [1:3] you can assign to array[4] (or array[0], or
array[2:7], etc). Restriction: you can't leave "holes" in the array,
so it only works for 1-D arrays. This will appear in 7.1.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера