title: function result type must be integer because of OUT parameters in postgresql
body: <p>In the below query when i execute it throws an error function result type must be integer because of OUT parameters.Pls anyone help me to overocme this issue.</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION funinsertupdateproduct(i_productid integer, t_productname text, t_productdesc text, i_brandid integer, i_varianceid integer, i_packsizeid integer, i_clientid integer, i_userid integer,out i_prodid integer )
    RETURNS void  AS
  $BODY$ 
  BEGIN 
      IF EXISTS (SELECT 1 FROM  "product" WHERE product_id = i_productid) THEN
          UPDATE "product" SET "product_name" = t_productname,  "product_desc" = t_productdesc, "brand_id"=i_brandid,variance_id=i_varianceid,pack_size_id=i_packsizeid  WHERE product_id = i_productid;
      ELSE
          INSERT INTO "product"("product_name", "product_desc", "create_by","client_id",variance_id,brand_id,pack_size_id ) VALUES (  t_productname, t_productdesc,i_userid,i_clientid,i_varianceid,i_brandid,i_packsizeid) returning product_id INTO i_prodid;
  
  END IF;
    RETURN;
  END;  
  $BODY$
    LANGUAGE plpgsql VOLATILE
    COST 100;
  ALTER FUNCTION funinsertupdateproduct(integer, text, text, integer, integer, integer, integer, integer,integer) OWNER TO postgres;
  </code></pre>