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,

> To all: is there a deeper reason why there is no array type for datatype
> record available?
Not enough demand :)

seams reasonable :)
 
Try:

 CREATE TYPE intarr AS (arr int[]);
 SELECT array(
   SELECT x::intarr FROM (
     SELECT array[2,3]
     UNION ALL
     SELECT array[3,4]) x(a));

and it should do the right thing in 8.3.

not exactly :)
ibox=# CREATE TYPE intarr AS (arr int[]);
CREATE TYPE
ibox=#  SELECT array(
      SELECT x::intarr FROM (
      SELECT array[2,3]
      UNION ALL
      SELECT array[3,4]) x(a));
           ?column?
-------------------------------
 {"(\"{2,3}\")","(\"{3,4}\")"}
(1 Zeile)

.... the result seems to be an array with two strings containing escaped string-represenations of arrays :)

I guess I will try to solve my challenge without arrays of arrays or records :)

Thanks for trying,

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