title: creating multi dimensional varchar/text arrays in plpgsql (postgres)
body: <p>i have some functionality i'd like to get from the server-side code into the database.</p>
  
  <p>i can't figure out how to set the values of a multi-demensional varchar array in plpgsql.</p>
  
  <p>here is an example of what i'm trying to do:</p>
  
  <pre><code>`CREATE OR REPLACE FUNCTION my_function (my_arg integer) RETURNS text[][] AS  
  $$   
  DECLARE  
     my_arr varchar[][];  
     r_row RECORD;  
     counter integer:= 1;  
  BEGIN  
     FOR r_row IN SELECT my_stuff1, my_stuff2 FROM my_table WHERE my_val = my_arg LOOP  
         my_arr[counter][1] := r_row.my_stuff1;
         my_arr[counter][2] := r_row.my_stuff2;
         my_arr[counter][3] := 'my_string';
     END LOOP;  
     return my_arr;
  END;  
  $$
  LANGUAGE plpgsql;`
  </code></pre>
  
  <p>for the life of me, i cannot figure out how to get this to work.</p>
  
  <p>any help would be great.  i am using postgres 8.1 by the way (stuck at that version).</p>