Seems like the max-value on ur sequence generator is greater than the value it
is generating now. If you want it to wrap around, you have to alter it, set the
max value to the value of your choice and set the 'CYCLE' option. When the
sequence generator hits the max value it will start from the minimum value
specified in its definition.
A quick search in google gave me this.......Look into it
www.postgresql.org/.../sql-altersequence.html
Also note that this is better done at DB level.