"Aurangzeb M. Agha" <aagha@bigfoot.com> writes:
> I quickly figured out that I can't update the last_value in my sequence
> table.
You can use setval(). However, if you're using a sequence to generate
IDs then it's fundamentally broken to assume there will be no gaps in
the assigned IDs. (You'll get a gap anytime an inserting transaction
fails after having done nextval().) I suggest rethinking your assumption
that there must be a consecutive sequence of TODO numbers ...
regards, tom lane