
create function tr_OldInventory() returns Trigger 
as 
$$
begin
insert into registro_inventory(inventory_id , film_id , store_id , fecha) 
values (old.inventory_id, old.film_id , old.store_id , old.last_update);
return new;
end
$$
language plpgsql;

create trigger inventory_update after update on inventory 
for each row execute procedure tr_OldInventory();

update inventory set film_id=2 where inventory_id=2
/*Comprobacion del UPDATE*/
select * from inventory where inventory_id=2
select * from registro_inventory
