DaVinci <bombadil(at)wanadoo(dot)es> writes:
> procedencia int2 references procedencia,
> lnea int2 references lnea,
> empresa int2 references empresa,
Depending on the data values you are working with, it could be that the
foreign key references cause interlocks --- ie, one transaction has to
wait to see if the other commits to know if it has a valid foreign key.
However, you still have not shown us a complete example that would allow
anyone else to reproduce your results.
regards, tom lane