title: Unable to create a PG sql function
body: <p>I want to create a function in Posgresql which returns a table:</p>
  
  <pre><code>create or replace function my_func1(var1 integer, var2 integer[], var3 integer)
    returns table(col1 integer, col2 integer, col3 timestamp) 
  as
  
  begin
  
      select  .........
  end;
  language sql;
  </code></pre>
  
  <p>It says:</p>
  
  <pre><code>ERROR:  syntax error at or near "begin"
  </code></pre>