#336 problem reproduced
#336 add() PGSQL function added
#336 explicit LOCK in SHARE ROW EXCLUSIVE mode fixed the problem
#336 typo