title: How can you expand a "condensed" PostgreSQL row into separate columns?
body: <p>I have a function which returns a table.</p>
  
  <p>If you run <code>SELECT * FROM some_function(12345)</code> the result is:</p>
  
  <pre><code>object_id | name
  ----------------
      12345 | "B"
  </code></pre>
  
  <p>If you run <code>SELECT some_function(12345)</code> the result is:</p>
  
  <pre><code>some_function
  -------------
  (12345,"B")
  </code></pre>
  
  <p>The problem is that I want the original form (so that I can access individual column values), but have the argument to <code>some_function()</code> come from a column in a table. I can execute <code>SELECT some_function(thing_id) FROM things</code> but this returns:</p>
  
  <pre><code>some_function
  -------------
  (12345,"B")
  (12346,"C")
  (12347,"D")
  </code></pre>
  
  <p>Whereas what I want returned is:</p>
  
  <pre><code>object_id | name
  ----------------
      12345 | "B"
      12346 | "C"
      12347 | "D"
  </code></pre>
  
  <p>So how can one "unnest" or "expand" such a condensed row?</p>