title: PL/pgSQL "Malformed array literal" error within for loop
body: <p>I have the following pl/pgsql function. (Obviously, this is not the full function, it's just the minimal amount of code needed to reproduce the problem)</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION test_func(infos TEXT[][])
  RETURNS void AS
  $$
  DECLARE
      info TEXT[];
      type TEXT[];
      name TEXT;
  BEGIN
      FOREACH info SLICE 1 IN ARRAY infos LOOP
          RAISE NOTICE 'Stuff: %', info;
          type := info[1];
          name := info[2];
          RAISE NOTICE 'Done with stuff';
      END LOOP;
  RETURN;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>When I run the function using <code>SELECT test_func('{{something, things},{other, data}}'::TEXT[][]);</code>, I get the following output:</p>
  
  <pre><code>NOTICE:  Stuff: {something,things}
  ERROR:  malformed array literal: "something"
  DETAIL:  Array value must start with "{" or dimension information.
  CONTEXT:  PL/pgSQL function test_func(text[]) line 10 at assignment
  </code></pre>
  
  <p>I don't understand how this error is happening. When the value of <code>info</code> is printed, it shows <code>{something,things}</code>, which seems to me to be a proper array literal.</p>
  
  <p>I am using PostgreSQL version 9.4.7, in case it matters.</p>