title: Pass multidimensional array as parameter to Postgresql function
body: <p>I'm trying to maintain a Php application with a PostgreSQL database. At one point, a stored procedure is called, lets say <code>function_x</code> and inside <code>function_x</code>, <code>function_y</code> is called; <code>function_y</code> is passed a variable named <code>parameter_1</code>, and the definition of parameter_1 is:</p>
  
  <pre><code>parameter_1 numeric[][3] := {};
  </code></pre>
  
  <p>I'm trying to do a select function_y directly on the command line (or pgadmin) but I'm having problems passing an empty array into the function. according to the <a href="http://www.postgresql.org/docs/9.1/static/xfunc-sql.html" rel="nofollow">docs</a> you have to use <code>variadic</code> but so I tried:</p>
  
  <pre><code>select function_y(581, 'CPN-00000000001-0000', 'TPN-00000000001-0001', 100, 2013, variadic arr := array[]);
  </code></pre>
  
  <p>But I got this error:</p>
  
  <pre><code>ERROR:  cannot determine type of empty array
  </code></pre>
  
  <p>I tried different approaches but nothing works. How can I pass a multidimensional array as a parameter at a query?</p>