Search Postgresql Archives

Re: creating array of integer[] out of query - how?

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

 



Sam,

No, as depesz says it's not doing that.  Depending on what you want out
you can get most of the way by having an array of ROWs that contain an
array of integers.  You just need to change:

the sad thing is:

  select array(
 select x from (
 select array[2,3] as a
 union
 select array[3,4] as a ) x);

ERROR:  could not find array type for datatype record

... I remember being there before :( arrays of rows are also not available.

To all: is there a deeper reason why there is no array type for datatype record available?

  [1] http://www.postgresql.org/docs/current/static/sql-createtype.html

Thanks for the hint with CREATE TYPE, especially the lines

"""
Whenever a user-defined type is created, PostgreSQL automatically creates an associated array type,
"""
fills me with joy. ;)

Thanks to depesz & you,

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
LASIK good, steroids bad?

[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