title: CURSOR vs select statement in loop
body: <p>I just saw a simple example in another StackOverflow question that used a cursor to loop through a table.  I would have just looped through the results of a select query instead of wrapping the select query in a cursor.  What is the advantage of using a cursor?</p>
  
  <p>(I couldn't include the example here because StackOverflow thought my question was mostly code, and demanded more details.  I've run into that annoying restriction before.  If I can ask my question clearly in just a few words, I should be able to.  I'll see if I can find a link to that question, and if I can, I'll add the link here.)</p>
  
  <p>Here is the <a href="https://stackoverflow.com/questions/7191902/cannot-select-from-update-returning-clause-in-postgres">original question</a> where I saw CURSOR used.</p>