I am trying to save the result of a SELECT query, pass it, and reuse it in another PL/pgSQL function:
DECLARE
  table_holder my_table; --the type of table_holder is my_table;
  result text;
BEGIN
  SELECT * INTO table_holder FROM table_holder ;
  result = another_function(table_holder);  
  return result;
END
The code for another_function(table_holder my_table), respectively:
BEGIN
  RETURN QUERY
  SELECT col FROM table_holder where id = 1;
END
Is it possible to run a SELECT query on a variable? If not, is there a way to get around this limitation?
I am using PostgreSQL 9.2.
 
     
    