Comments on: Converting rows (records) to and from arrays in Postgres https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html Just another WordPress site Thu, 23 Sep 2010 08:39:31 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Sposmen https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html#comment-110 Thu, 23 Sep 2010 08:39:31 +0000 https://grey-panther.net/?p=746#comment-110 Sometimes you need directly from a table…

SELECT t.id, t.data1, t.data2, t.data3, t.data_in_array[t_idx.idx]
FROM table1 as t,
(SELECT id, generate_series(1,array_upper(data_in_array, 1)) as idx FROM table1) as t_idx
WHERE t.id = t_idx.id

]]>
By: Anonymous https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html#comment-119 Thu, 29 Jul 2010 23:52:03 +0000 https://grey-panther.net/?p=746#comment-119 Hi All, their is quite modification in above command,
select array(select id from table) into arrayname;

]]>
By: Anonymous https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html#comment-138 Tue, 18 May 2010 12:00:52 +0000 https://grey-panther.net/?p=746#comment-138 This is helpful to me:

select array(select id from table)

Thanks!

]]>
By: Anonymous https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html#comment-324 Sun, 26 Jul 2009 17:29:00 +0000 https://grey-panther.net/?p=746#comment-324 thanks. very helpful

]]>
By: Anonymous https://grey-panther.net/2008/05/converting-rows-records-to-and-from-arrays-in-postgres.html#comment-588 Thu, 11 Dec 2008 13:57:38 +0000 https://grey-panther.net/?p=746#comment-588 thanks from Brasil.
this helped me a lot very much.

]]>