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.
I am new to postgres, so would appreciate if someone could guide or explain how to do this.
Here is my sample function:
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'