Search Postgresql Archives

trouble selecting from array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux