title: Is there an alternative to temp tables in PostgreSQL to hold and manipulate result sets?
body: <p>Within a plpgsql function, I need to hold the result set of a select statement and perform many subsequent <em>queries</em> and <em>manipulations</em> over that set.</p>
  
  <p>I read about temp tables in PostgreSQL, but these tables are visible in session/transaction scope, while i need my table (or any data structure holding result set) to be locally visible and only exist within the function, so that each function call can have its own copy of that (table/data structure)</p>
  
  <p>I simply need a table alike structure to hold select result set within a function call, instead of temp tables. 
  Is there such thing?</p>