The SQL standard defines a separate error code for nextval exhausting
the sequence space. I haven't found any discussion of this in the
archives, so it seems this was just not considered or not yet in
existence when the error codes were introduced. Here is a patch to
correct it.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services