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

From Massa, Harald Armin
Subject Re: creating array of integer[] out of query - how?
Date
Msg-id e3e180dc0909020250l475e380m834d1c5c083e4096@mail.gmail.com
Whole thread Raw
In response to Re: creating array of integer[] out of query - how?  (Sam Mason <sam@samason.me.uk>)
Responses Re: creating array of integer[] out of query - how?
List pgsql-general
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?

pgsql-general by date:

Previous
From: "Markus Wanner"
Date:
Subject: PostgreSQL Conference 2009 Japan
Next
From: Sam Mason
Date:
Subject: Re: creating array of integer[] out of query - how?