trouble selecting from array

Поиск
Список
Период
Сортировка
От brian
Тема trouble selecting from array
Дата
Msg-id 47EC2FF5.3080303@zijn-digital.com
обсуждение исходный текст
Ответы Re: trouble selecting from array  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Using 8.3

I have a table which has a column (tdr_tags) defined as integer[][]. The
table description shows the column as integer[]. I understand from the
docs that this is normal ("declaring number of dimensions or sizes in
CREATE TABLE is simply documentation").

If I select the column as tdr_tags I get:

{{161377},{32}}
{{206507},{39}}
{{232972,292831},{45,51}}
...

But, wanting just the 2nd inner array, if I try tdr_tags[2] I get NULL.
In fact, if use any array index at all I get back NULL. What I was
aiming to do was to select into a record in pl/pgsql and loop over the
content of the 2nd array.

Also, is there anything special required to load array data using COPY?
Does it require quoting? If so, is there any reason why pg_dump wouldn't
quote each array?

I've been searching online and haven't come across anything at all
related to this. I've never used arrays in Postgres before and this
particular instance will be a one-off.



В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Survey: renaming/removing script binaries (createdb, createuser...)
Следующее
От: Sam Mason
Дата:
Сообщение: Re: dunction issue