Thanks Jeff - you saved me some time - reorganising functions to work with different tables would take time... what potentially will not give us solution :(
"The more likely suspect is a foreign key conflict.
Are both transactions inserting/updating rows that could reference
the same row(s) in a master table?" - Tom Lane
This is exactly the case (in my case) - several connections tries to insert rows in the same table... but some columns are referenced to settings tables... and there is possibility that two rows what we want to insert reference the same row in settings table...
Unless you are running an ancient version of PostgreSQL (<8.1), this would no longer pose a problem.