title: Flattening a relation with an array to emit one row per array entry
body: <p>Given a table defined as such:</p>
  <pre><code>CREATE TABLE test_values(name TEXT, values INTEGER[]);
  </code></pre>
  <p>...and the following values:</p>
  <pre><code>| name  | values  |
  +-------+---------+
  | hello | {1,2,3} |
  | world | {4,5,6} |
  </code></pre>
  <p>I'm trying to find a query which will return:</p>
  <pre><code>| name  | value |
  +-------+-------+
  | hello | 1     |
  | hello | 2     |
  | hello | 3     |
  | world | 4     |
  | world | 5     |
  | world | 6     |
  </code></pre>
  <p>I've reviewed <a href="https://www.postgresql.org/docs/9.2/arrays.html#ARRAYS-ACCESSING" rel="nofollow noreferrer">the upstream documentation on accessing arrays</a>, and tried to think about what a solution using <a href="https://www.postgresql.org/docs/9.2/functions-array.html#ARRAY-FUNCTIONS-TABLE" rel="nofollow noreferrer">the <code>unnest()</code> function</a> would look like, but have been coming up empty.</p>
  <p>An ideal solution would be easy to use even in cases where there were a significant number of columns other than the array being expanded and no primary key. Handling a case with more than one array is not important.</p>