David Kammer <djkammer@u.washington.edu> writes:
> Notice that even though the second insert failed, it still incremented
> the serial value. This seems counter intuative to the way that serial
> should work. Is this truly a bug,
No. nextval() calls never roll back; see the documentation.
> is there a good work around?
Don't assume that a serial column is without gaps. It's only intended
to be unique.
regards, tom lane