title: ERROR: syntax error at or near "RETURN" , PostgreSQL function
body: <p>I am trying to write a function which returns a json data from my table by adding person id . 
  I am using pgAdmin 4 for it.</p>
  
  <pre><code>CREATE FUNCTION public.getuserinfo(IN userid bigint DEFAULT 00000, OUT uinfo json)
  RETURNS SETOF json
  LANGUAGE 'sql'
  VOLATILE 
  AS $BODY$
  SELECT info into uinfo FROM public.users Where uid=userid;
  RETURN uinfo;
  $BODY$;
  ALTER FUNCTION public.getuserinfo(bigint)
   OWNER TO sun;
  GRANT EXECUTE ON FUNCTION public.getuserinfo(bigint) TO sun 
  WITH GRANT OPTION;
  REVOKE ALL ON FUNCTION public.getuserinfo(bigint) FROM 
  PUBLIC;
  COMMENT ON FUNCTION public.getuserinfo(bigint)
    IS 'gets user info by id';
  </code></pre>
  
  <p>but i am getting this error.<a href="https://i.stack.imgur.com/FmylY.png" rel="nofollow noreferrer">error image</a>
  i searched on tutorials and another previous post <a href="https://stackoverflow.com/questions/27654911/syntax-error-at-or-near-where">this</a>
  but got no help. thanks in advance.</p>