Re: [SQL] select result into string's array

2009-10-09 Thread Alberto Asuero Arroyo
Dmitriy Igrishin wrote: > Hello. > > You should use an array constructor: > > DECLARE > m_array text[]; > [..] > BEGIN > FOR m_array IN SELECT ARRAY[col_1, col_2, col_N] FROM my_table LOOP > [..] > END LOOP; > > Regards, > Igrishin Dmitriy. > > 2009/10/9 Alberto Asuero Arroyo

Re: [SQL] select result into string's array

2009-10-09 Thread Dmitriy Igrishin
Hello. You should use an array constructor: DECLARE m_array text[]; [..] BEGIN FOR m_array IN SELECT ARRAY[col_1, col_2, col_N] FROM my_table LOOP [..] END LOOP; Regards, Igrishin Dmitriy. 2009/10/9 Alberto Asuero Arroyo > Hi, > > I need to store the result of select into an array of

Re: [SQL] select result into string's array

2009-10-09 Thread A. Kretschmer
In response to Alberto Asuero Arroyo : > Hi, > > I need to store the result of select into an array of string: test=*# select * from foo; t -- foo bar batz (3 rows) test=*# select array_agg(t) from foo; array_agg {foo,bar,batz} (1 row) Helps that? Andreas -- And

[SQL] select result into string's array

2009-10-09 Thread Alberto Asuero Arroyo
Hi, I need to store the result of select into an array of string: /create or replace function search_engine.test/ /(/ /)/ /returns integer as $$/ /declare/ /m_array text[];/ /begin/ /for m_array in select * from my_table loop/ /raise notice