title: Function returns only one column when return type is record type postgres
body: <p>I have a function that has the return type of record.</p>
  
  <p>Below is the function am using, basically what the function does is , it takes in input paramter and queries the database to return the columns:</p>
  
  <pre><code>drop function if exists test_proc(sr_number1 bigint);
  create or replace function test_proc(sr_number1 bigint) RETURNS record /*SETOF tbl*/ AS $$
  
  declare
  i integer default 0;
  record_type record;
  begin
  select sr_num,product_number,phone,addr into record_type from my_table where sr_num=sr_number1;
  return record_type;
  end
  $$ LANGUAGE plpgsql; 
  </code></pre>
  
  <p>Unfortunately, when I execute the function as </p>
  
  <p>select test_proc(12345);  I get the result as a comma separated list in just one column like (sr_num,product_number,phone,addr). But what I was hoping to have it return was a table row with the column values and their respective column names.</p>
  
  <p>I also tried executing the function as </p>
  
  <pre><code>select * from test_proc(12345); but get the following error
  
  ERROR:  a column definition list is required for functions returning "record"
  </code></pre>