Re: creating array of integer[] out of query - how? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: creating array of integer[] out of query - how?
Date
Msg-id b42b73150909020731qa02cb4cs31bbfce19b884ef3@mail.gmail.com
Whole thread Raw
In response to Re: creating array of integer[] out of query - how?  ("Massa, Harald Armin" <chef@ghum.de>)
Responses Re: creating array of integer[] out of query - how?
List pgsql-general
On Wed, Sep 2, 2009 at 9:47 AM, Massa, Harald Armin<chef@ghum.de> wrote:
> 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 :)


nope...it's an array of composite types, each type with one field, and
array of two ints. this is waht you wanted? what are you trying to do
exactly?

merlin

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: creating array of integer[] out of query - how?
Next
From: "Wellmann, Harald"
Date:
Subject: Subselect problem