Thanks Shane. I solved taking trace of the sequence value directly in the program...it is not a good solution but it works until I find a better one!
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных