Aqui te pongo la funcion o procedimiento:
Código SQL
[-]CREATE OR REPLACE FUNCTION update_tip_incidencia(_tipinci character, _desctipinci character, _codinci integer)
RETURNS boolean AS
$BODY$
begin
update tipo_incidencia set nom_tipo=_tipinci,descr_tipo=_desctipinci where idtipoinci=_codinci;
RETURN True;
exception
when integrity_constraint_violation then
RAISE NOTICE 'Rollback to savepoint';
RETURN False;
end;$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;