On Sun, Aug 16, 2009 at 05:55:08AM -0400, torea...@fastmail.fm wrote:
> Thank you for your recommendation
> I was able to get this to work
> 
> select ('{{A,B,C},{D,E,F}}'::text[][])[i][j] from
>   generate_series(1, array_upper('{{A,B,C},{D,E,F}}'::text[][], 1)) i
>   cross join 
>   generate_series(1, array_upper('{{A,B,C},{D,E,F}}'::text[][], 2)) j

I've just noticed that you mentioned using 8.4 previously; there's a new
function called unnest in 8.4 that does the above.  In your example it
would be:

  SELECT unnest('{{A,B,C},{D,E,F}}'::text[]);

and you'd get back your six rows.  It appears to do the correct thing
with arrays of higher dimensionality to me, but I only tried up to five.

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to