title: Call PL/pgSQL function multiple times with SELECT results
body: <p>I have a PL/pgSQL function which requires one input parameter which is the primary key of the table on which it works. I call it as follows:</p>
  
  <pre><code>select myFunction('0001');
  </code></pre>
  
  <p>It then does some calculations on the data in the row identified by <code>'0001'</code> of a particular table and performs an <code>UPDATE</code>.</p>
  
  <p>How can I call the function repeatedly for each primary key returned by a query? Something like the following:</p>
  
  <pre><code>select myFunction(select ID from theTable);
  </code></pre>