postgres sequence error fix, issue #602
Merge pull request #603 from mariroz/dev

postgres sequence error fix, issue #602