http://qs321.pair.com?node_id=433886


in reply to Re^2: Need help with DBD::Pg
in thread Need help with DBD::Pg

That code is incorrectly designed. Another process could call nextval() between the INSERT and SELECT. Sequences are not atomic in transactions.

Sequences are to be used by calling nextval() first and then inserting that value in a second statement. The database guarantees that no clients will retrieve the same nextval.