Обсуждение: Problems with array

Поиск
Список
Период
Сортировка

Problems with array

От
sonia sanchez diaz
Дата:
Hello there!

I'm using postgresql 7.2.1.

I have a table and I need to create a type array field,  this field must
 have two dimensions, but when I alter the table, only create the field
with one dimension.

I do this:

alter table one_table add column column_added numeric[][];

And the table is altered, but when I get the description of this, only
one dimension of the array is defined.

Something is wrong or in the definition of an array only shows one
dimension whatever it has?

Tnanks in advance!

Salut.

Sonia




Re: Problems with array

От
Tom Lane
Дата:
sonia sanchez diaz <geek24@avantel.net> writes:
> Something is wrong or in the definition of an array only shows one
> dimension whatever it has?

Yup, an array column is just an array column, there isn't any
enforcement of a specific number of dimensions.  Putting extra []'s in
the declaration is just syntactic sugar.

            regards, tom lane

Re: Problems with array

От
"Chad R. Larson"
Дата:
At 09:52 AM 8/23/02 , Tom Lane wrote:
>Yup, an array column is just an array column, there isn't any enforcement
>of a specific number of dimensions.  Putting extra []'s in the declaration
>is just syntactic sugar.

Just the same as in the C language.  Multi-dimensional arrays are just
special case pointer arithmetic on a single string of bytes.


         -crl
--
Chad R. Larson (CRL22)    chad@eldocomp.com
   Eldorado Computing, Inc.   602-604-3100
      5353 North 16th Street, Suite 400
        Phoenix, Arizona   85016-3228