title: Retrieve the inserted/updated/deleted record in same function in postgres
body: <p>I am using a function to insert values into a table in postgres. Is it possible to retrieve the inserted/updated/deleted record in same function.</p>
  
  <p>I am new to postgres, so would appreciate if someone could guide or explain how to do this.</p>
  
  <p>Here is my sample function:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION SampleFunction (in name varchar, in descsciption varchar, in userid varchar) RETURNS void AS
  $BODY$
  begin     
      insert into sampletable(id,categoryname,categorydesc,createdby) 
      values(default,name,descsciption,userid);        
  end
  $BODY$
  LANGUAGE 'plpgsql'
  </code></pre>