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

Поиск
Список
Период
Сортировка
От Massa, Harald Armin
Тема Re: creating array of integer[] out of query - how?
Дата
Msg-id e3e180dc0909020647l63c59cfcsb0cbf9fc0434111a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: creating array of integer[] out of query - how?  (Sam Mason <sam@samason.me.uk>)
Ответы Re: creating array of integer[] out of query - how?  (Sam Mason <sam@samason.me.uk>)
Re: creating array of integer[] out of query - how?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
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?

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

Предыдущее
От: "tanjunhua"
Дата:
Сообщение: Re: Join efficiency
Следующее
От: Gordon Ross
Дата:
Сообщение: PL/SQL & unset custom variable