title: unwrap postgresql array into rows
body: <p>What is the fastest way to unwrap array into rows in PostgreSQL? For instance,</p>
  
  <p>We have:</p>
  
  <pre><code>a
  -
  {1,2}
  {2,3,4}
  </code></pre>
  
  <p>And we need:</p>
  
  <pre><code>b
  - 
  1
  2
  2
  3
  4
  </code></pre>
  
  <p>I'm using:</p>
  
  <pre><code>select explode_array(a) as a from a_table;
  </code></pre>
  
  <p>where explode_array is:</p>
  
  <pre><code>create or replace function explode_array(in_array anyarray) returns setof anyelement as
  $$
      select ($1)[s] from generate_series(1,array_upper($1, 1)) as s;
  $$
  </code></pre>
  
  <p>Is there any better way?</p>